Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions
dmlc::MemoryStringStream Struct Reference

A in memory stream that is backed by std::string. This class allows us to read/write from/to a std::string. More...

#include <memory_io.h>

Inheritance diagram for dmlc::MemoryStringStream:
dmlc::SeekStream dmlc::Stream

Public Member Functions

 MemoryStringStream (std::string *p_buffer)
 constructor
 
virtual size_t Read (void *ptr, size_t size)
 reads data from a stream
 
virtual void Write (const void *ptr, size_t size)
 writes data to a stream
 
virtual void Seek (size_t pos)
 seek to certain position of the file
 
virtual size_t Tell (void)
 tell the position of the stream
 
- Public Member Functions inherited from dmlc::Stream
virtual ~Stream (void)
 virtual destructor
 
template<typename T >
void Write (const T &data)
 writes a data to stream.
 
template<typename T >
bool Read (T *out_data)
 loads a data from stream.
 
template<typename T >
void WriteArray (const T *data, size_t num_elems)
 Endian aware write array of data.
 
template<typename T >
bool ReadArray (T *data, size_t num_elems)
 Endian aware read array of data.
 

Additional Inherited Members

- Static Public Member Functions inherited from dmlc::SeekStream
static SeekStreamCreateForRead (const char *uri, bool allow_null=false)
 generic factory function create an SeekStream for read only, the stream will close the underlying files upon deletion error will be reported and the system will exit when create failed
 
- Static Public Member Functions inherited from dmlc::Stream
static StreamCreate (const char *uri, const char *const flag, bool allow_null=false)
 generic factory function create an stream, the stream will close the underlying files upon deletion
 

Detailed Description

A in memory stream that is backed by std::string. This class allows us to read/write from/to a std::string.

Constructor & Destructor Documentation

◆ MemoryStringStream()

dmlc::MemoryStringStream::MemoryStringStream ( std::string *  p_buffer)
inlineexplicit

constructor

Parameters
p_bufferthe pointer to the string.

Member Function Documentation

◆ Read()

virtual size_t dmlc::MemoryStringStream::Read ( void *  ptr,
size_t  size 
)
inlinevirtual

reads data from a stream

Parameters
ptrpointer to a memory buffer
sizeblock size
Returns
the size of data read

Implements dmlc::Stream.

◆ Seek()

virtual void dmlc::MemoryStringStream::Seek ( size_t  pos)
inlinevirtual

seek to certain position of the file

Implements dmlc::SeekStream.

◆ Tell()

virtual size_t dmlc::MemoryStringStream::Tell ( void  )
inlinevirtual

tell the position of the stream

Implements dmlc::SeekStream.

◆ Write()

virtual void dmlc::MemoryStringStream::Write ( const void *  ptr,
size_t  size 
)
inlinevirtual

writes data to a stream

Parameters
ptrpointer to a memory buffer
sizeblock size

Implements dmlc::Stream.


The documentation for this struct was generated from the following file: