CatapultServer  v0.5.0.1 (Elephant)
catapult::io::StringOutputStream Class Reference

String output stream. More...

Inheritance diagram for catapult::io::StringOutputStream:
Collaboration diagram for catapult::io::StringOutputStream:

Public Member Functions

 StringOutputStream (size_t capacity)
 Creates string output stream with reserved capacity. More...
 
void write (const RawBuffer &buffer) override
 
void flush () override
 
const std::string & str () const
 Returns underlying string. More...
 
- Public Member Functions inherited from catapult::io::OutputStream
virtual ~OutputStream ()=default
 

Private Attributes

std::string m_output
 

Detailed Description

String output stream.

Constructor & Destructor Documentation

◆ StringOutputStream()

catapult::io::StringOutputStream::StringOutputStream ( size_t  capacity)
inlineexplicit

Creates string output stream with reserved capacity.

Member Function Documentation

◆ flush()

void catapult::io::StringOutputStream::flush ( )
inlineoverridevirtual

Commits all pending data.

Exceptions
catapult_file_io_errorif flush failed.

Implements catapult::io::OutputStream.

◆ str()

const std::string& catapult::io::StringOutputStream::str ( ) const
inline

Returns underlying string.

Here is the caller graph for this function:

◆ write()

void catapult::io::StringOutputStream::write ( const RawBuffer &  buffer)
inlineoverridevirtual

Writes data pointed to by buffer to this stream.

Exceptions
catapult_file_io_errorif proper amount of data could not be written.

Implements catapult::io::OutputStream.

Here is the caller graph for this function:

Member Data Documentation

◆ m_output

std::string catapult::io::StringOutputStream::m_output
private

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