|
Medial Code Documentation
|
interface of i/o stream that support seek More...
#include <io.h>
Public Member Functions | |
| virtual void | Seek (size_t pos)=0 |
| seek to certain position of the file | |
| virtual size_t | Tell (void)=0 |
| tell the position of the stream | |
Public Member Functions inherited from dmlc::Stream | |
| virtual size_t | Read (void *ptr, size_t size)=0 |
| reads data from a stream | |
| virtual void | Write (const void *ptr, size_t size)=0 |
| writes data to a 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. | |
Static Public Member Functions | |
| static SeekStream * | CreateForRead (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 Stream * | Create (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 | |
interface of i/o stream that support seek
|
static |
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
| uri | the uri of the input currently we support hdfs://, s3://, and file:// by default file:// will be used |
| allow_null | whether NULL can be returned, or directly report error |
|
pure virtual |
seek to certain position of the file
Implemented in dmlc::MemoryFixedSizeStream, dmlc::MemoryStringStream, dmlc::io::HDFSStream, dmlc::io::FileStream, dmlc::io::s3::CURLReadStreamBase, and rabit::utils::MemoryBufferStream.
|
pure virtual |
tell the position of the stream
Implemented in rabit::utils::MemoryFixSizeBuffer, rabit::utils::MemoryBufferStream, dmlc::MemoryFixedSizeStream, dmlc::MemoryStringStream, dmlc::io::HDFSStream, dmlc::io::FileStream, and dmlc::io::s3::CURLReadStreamBase.