37 const void*
data,
const uint64_t nBytesInData)
63 "[CMemoryStream::resize] Cannot change memory block size since it " 64 "was set with 'assign'");
90 size_t nToRead = std::min<size_t>(Count, maxAvail);
109 if (requiredSize >=
m_size)
211 if (fd->do_free)
delete fd->
buf;
TSeekOrigin
Used in CStream::Seek.
void set(const T *p)
This method can change the pointer, since the change is made explicitly, not through copy operators t...
bool loadBufferFromFile(const std::string &file_name)
Loads the entire buffer from a file *.
#define THROW_EXCEPTION(msg)
void free_fn_for_zmq(void *data, void *hint)
Used in mrpt_send_to_zmq().
uint64_t getTotalBytesCount() const override
Returns the total size of the internal buffer.
bool saveBufferToFile(const std::string &file_name)
Saves the entire buffer to a file.
#define ASSERT_(f)
Defines an assertion mechanism.
void * getRawBufferData()
Method for getting a pointer to the raw stored data.
void assignMemoryNotOwn(const void *data, const uint64_t nBytesInData)
Initilize the data in the stream from a block of memory which is NEITHER OWNED NOR COPIED by the obje...
uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning) override
Introduces a pure virtual method for moving to a specified position in the streamed resource...
uint64_t getPosition() const override
Method for getting the current cursor position, where 0 is the first byte and TotalBytesCount-1 the l...
CMemoryStream()=default
Default constructor.
~CMemoryStream() override
Destructor.
This CStream derived class allow using a file as a write-only, binary stream.
uint64_t m_alloc_block_size
size_t Write(const void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for writing to the stream.
size_t Read(void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for reading from the stream.
void_ptr_noncopy m_memory
Internal data.
size_t Write(const void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for writing to the stream.
void resize(uint64_t newSize)
Resizes the internal buffer size.
void clear()
Clears the memory buffer.
bool m_read_only
If the memory block does not belong to the object.
void memcpy(void *dest, size_t destSize, const void *src, size_t copyCount) noexcept
An OS and compiler independent version of "memcpy".
static struct FontData data