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;
150 virtual char *readString(
int delimiter);
183 void* defaultRealloc(
void*,
size_t);
197 #endif // LT_IO_DYNAMIC_MEM_STREAM_H LTIOSeekDir
Stream seek directions.
lt_uint32 m_cur
current position
lt_uint32 LT_STATUS
An integral status code.
lt_uint32 m_bufferSize
size of buffer as allocated
const lt_uint8 * getData() const
Get the underlying buffer.
#define LT_BEGIN_NAMESPACE(theNameSpace)
compiler does not support namespaces
Deallocator m_dealloc
deallocator
Deallocator getDeallocator() const
Returns the deallocator function pointer.
unsigned int lt_uint32
unsigned 32-bit integer
Allocator m_alloc
allocator function
Reallocator getReallocator() const
Returns the reallocator function pointer.
lt_uint32 m_userSize
size of buffer as accessible by user
unsigned char lt_uint8
unsigned 8-bit integer
Reallocator m_realloc
reallocator
lt_uint8 * m_data
pointer to buffer
float m_growthRate
the factor of growth of the memory [1-2):
Abstract definition of a stream.
Allocator getAllocator() const
Returns the allocator function pointer.
#define LT_END_NAMESPACE(theNameSpace)
compiler does not support namespaces
holds a memory buffer of variable size
lt_uint32 m_initialSize
initial size of buffer
lt_uint64 size() const
Returns the number of bytes which are in the stream.