55 if (count >
room())
return (UINT32_MAX);
78 virtual int read(
void* dest, uint32_t src,
size_t count) = 0;
88 virtual int write(uint32_t dest,
const void* src,
size_t count) = 0;
132 int read(
void*
buf, uint32_t offset,
size_t size)
134 if (offset + size <= SIZE)
148 int write(uint32_t offset,
const void*
buf,
size_t size)
150 if (offset + size <= SIZE)
184 Block(mem, size * nmemb),
201 return (
m_addr + (ix * MSIZE));
288 if (m_count == SIZE)
return (0);
292 if (m_put == SIZE) m_put = 0;
293 return (
sizeof(byte));
304 virtual size_t write(
const uint8_t *buffer,
size_t size)
306 uint16_t
room = SIZE - m_count;
307 if (room == 0)
return (0);
308 if (size > room) size =
room;
342 if (m_count == 0)
return (-1);
356 if (m_count == 0)
return (-1);
361 if (m_get == SIZE) m_get = 0;
uint32_t addr(size_t ix=0)
uint32_t alloc(size_t count)
int read(void *buf, uint32_t offset, size_t size)
int write(uint32_t offset, const void *buf, size_t size)
virtual int read(void *dest, uint32_t src, size_t count)=0
Block(Storage &mem, uint32_t size)
Cache(Storage &mem, void *buf, size_t size, size_t nmemb=1)
virtual size_t write(uint8_t byte)
virtual size_t write(const uint8_t *buffer, size_t size)
Stream(Storage &mem, size_t size)
virtual int write(uint32_t dest, const void *src, size_t count)=0