9 #ifndef CMEMORYSTREAM_H
10 #define CMEMORYSTREAM_H
34 size_t Read(
void *Buffer,
size_t Count);
39 size_t Write(
const void *Buffer,
size_t Count);
44 uint64_t
m_size, m_position, m_bytesWritten;
50 void resize(uint64_t newSize);
59 CMemoryStream(
const void *data,
const uint64_t nBytesInData );
65 void assignMemoryNotOwn(
const void *data,
const uint64_t nBytesInData );
78 void changeSize( uint64_t newSize );
87 uint64_t getTotalBytesCount();
91 uint64_t getPosition();
96 void* getRawBufferData();
102 bool saveBufferToFile(
const std::string &file_name );
107 bool loadBufferFromFile(
const std::string &file_name );
113 m_alloc_block_size = alloc_block_size;
uint64_t m_alloc_block_size
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
This CStream derived class allow using a memory buffer as a CStream.
TSeekOrigin
Used in CStream::Seek.
bool m_read_only
If the memory block does not belong to the object.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void setAllocBlockSize(uint64_t alloc_block_size)
Change the size of the additional memory block that is reserved whenever the current block runs too s...
void_ptr_noncopy m_memory
Internal data.