14 #ifndef LT_IO_DYNAMIC_MEM_STREAM_H
15 #define LT_IO_DYNAMIC_MEM_STREAM_H
38 #if defined(LT_OS_WINCE)
39 typedef void* (__cdecl * Allocator)(
size_t);
40 typedef void(__cdecl *Deallocator)(
void*);
41 typedef void*(__cdecl *Reallocator)(
void*,
size_t);
43 typedef void*(*Allocator)(size_t);
44 typedef void(*Deallocator)(
void*);
45 typedef void*(*Reallocator)(
void*,size_t);
79 Allocator allo, Deallocator deallo,
80 Reallocator reallo=NULL,
float growthRate=2 );
85 virtual bool isOpen();
91 virtual lt_int64 tell();
143 lt_uint64
size()
const {
return m_userSize; }
147 virtual LTIOStreamInf* duplicate();
149 virtual const char* getID()
const;
182 void* defaultRealloc(
void*,
size_t);
196 #endif // LT_IO_DYNAMIC_MEM_STREAM_H
holds a memory buffer of variable size
float m_growthRate
the factor of growth of the memory [1-2):
lt_uint32 m_initialSize
initial size of buffer
Deallocator m_dealloc
deallocator
Abstract definition of a stream.
unsigned int lt_uint32
unsigned 32-bit integer
#define LT_BEGIN_NAMESPACE(theNameSpace)
compiler does not support namespaces
lt_uint32 m_userSize
size of buffer as accessible by user
lt_uint32 m_cur
current position
Allocator getAllocator() const
Returns the allocator function pointer.
lt_uint32 m_bufferSize
size of buffer as allocated
LTIOSeekDir
Stream seek directions.
unsigned char lt_uint8
unsigned 8-bit integer
Deallocator getDeallocator() const
Returns the deallocator function pointer.
Allocator m_alloc
allocator function
#define LT_END_NAMESPACE(theNameSpace)
compiler does not support namespaces
lt_uint64 size() const
Returns the number of bytes which are in the stream.
const lt_uint8 * getData() const
Get the underlying buffer.
Reallocator m_realloc
reallocator
lt_uint8 * m_data
pointer to buffer
lt_uint32 LT_STATUS
An integral status code.
Reallocator getReallocator() const
Returns the reallocator function pointer.