Medial Code Documentation
Loading...
Searching...
No Matches
Data Structures | Public Member Functions
dmlc::ostream Class Reference

a std::ostream class that can can wrap Stream objects, can use ostream with that output to underlying Stream More...

#include <io.h>

Inheritance diagram for dmlc::ostream:

Public Member Functions

 ostream (Stream *stream, size_t buffer_size=(1<< 10))
 construct std::ostream type
 
void set_stream (Stream *stream)
 set internal stream to be stream, reset states
 
size_t bytes_written (void) const
 

Detailed Description

a std::ostream class that can can wrap Stream objects, can use ostream with that output to underlying Stream

Usage example:

Stream *fs = Stream::Create("hdfs:///test.txt", "w");
os << "hello world" << std::endl;
delete fs;
interface of stream I/O for serialization
Definition io.h:30
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
Definition io.cc:132
a std::ostream class that can can wrap Stream objects, can use ostream with that output to underlying...
Definition io.h:314

Constructor & Destructor Documentation

◆ ostream()

dmlc::ostream::ostream ( Stream stream,
size_t  buffer_size = (1 << 10) 
)
inlineexplicit

construct std::ostream type

Parameters
streamthe Stream output to be used
buffer_sizeinternal streambuf size

Member Function Documentation

◆ bytes_written()

size_t dmlc::ostream::bytes_written ( void  ) const
inline
Returns
how many bytes we written so far

◆ set_stream()

void dmlc::ostream::set_stream ( Stream stream)
inline

set internal stream to be stream, reset states

Parameters
streamnew stream as output

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