41 virtual size_t Read(
void* Buffer,
size_t Count) = 0;
46 virtual size_t Write(
const void* Buffer,
size_t Count) = 0;
64 return Read(Buffer, Count);
80 virtual uint64_t
Seek(
95 virtual int printf(
const char* fmt, ...)
101 template <typename CONTAINER_TYPE>
103 const
char* fmt, const CONTAINER_TYPE& V,
char separator = ',')
106 const size_t N = V.size();
107 for (
size_t i = 0; i < N; i++)
110 if (i != (N - 1)) this->
printf(
"%c", separator);
119 bool getline(std::string& out_str);
TSeekOrigin
Used in CStream::Seek.
virtual int printf(const char *fmt,...) MRPT_printf_format_check(2
Writes a string to the stream in a textual form.
virtual size_t Read(void *Buffer, size_t Count)=0
Introduces a pure virtual method responsible for reading from the stream.
virtual uint64_t getTotalBytesCount() const =0
Returns the total amount of bytes in the stream.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
virtual uint64_t getPosition() const =0
Method for getting the current cursor position, where 0 is the first byte and TotalBytesCount-1 the l...
virtual size_t Write(const void *Buffer, size_t Count)=0
Introduces a pure virtual method responsible for writing to the stream.
virtual uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning)=0
Introduces a pure virtual method for moving to a specified position in the streamed resource...
virtual size_t ReadBufferImmediate(void *Buffer, size_t Count)
Reads a block of bytes from the stream into Buffer, and returns the amound of bytes actually read...
bool getline(std::string &out_str)
Reads from the stream until a ' ' character is found ('' characters are ignored). ...
#define MRPT_printf_format_check(_FMT_, _VARARGS_)
virtual int void printf_vector(const char *fmt, const CONTAINER_TYPE &V, char separator=',')
Prints a vector in the format [A,B,C,...] using CStream::printf, and the fmt string for each vector e...