20 #if !defined(__MITSUBA_CORE_MSTREAM_H_)
21 #define __MITSUBA_CORE_MSTREAM_H_
23 #include <mitsuba/mitsuba.h>
85 void read(
void *ptr,
size_t size);
86 void write(
const void *ptr,
size_t size);
87 void seek(
size_t pos);
103 void resize(
size_t newSize);
const uint8_t * getCurrentData() const
Return the underlying data at the current position (const version)
Definition: mstream.h:73
const uint8_t * getData() const
Return the underlying data (const version)
Definition: mstream.h:67
virtual void flush()=0
Flush the stream's buffers.
uint8_t * getData()
Return the underlying data.
Definition: mstream.h:64
virtual bool canRead() const =0
Can we read from the stream?
#define MTS_EXPORT_CORE
Definition: getopt.h:29
virtual bool canWrite() const =0
Can we write to the stream?
virtual void read(void *ptr, size_t size)=0
Read a specified amount of data from the stream.
uint8_t * getCurrentData()
Return the underlying data at the current position.
Definition: mstream.h:70
Abstract seekable stream class.
Definition: stream.h:58
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Simple memory buffer-based stream with automatic memory management.
Definition: mstream.h:35
virtual void write(const void *ptr, size_t size)=0
Write a specified amount of data into the stream.
virtual size_t getPos() const =0
Get the current position inside the stream.
virtual std::string toString() const
Return a string representation.
virtual void seek(size_t pos)=0
Seek to a position inside the stream.
virtual size_t getSize() const =0
Return the size of the stream.
virtual void truncate(size_t size)=0
Truncate the stream to a given size.