OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
StringOutputStream Class Reference

#include <StringOutputStream.h>

Inheritance diagram for StringOutputStream:
OutputStream BlobOutputStream detail::MemoryFileSystemOutputStream

Public Member Functions

 StringOutputStream ()=default
 
 StringOutputStream (std::string *target, std::string_view displayPath={})
 
virtual ~StringOutputStream ()
 
void open (std::string *target, std::string_view displayPath={})
 
virtual void write (const void *data, size_t size) override
 
virtual void flush () override
 
virtual void close () override
 
virtual std::string displayPath () const override
 
virtual void write (const void *data, size_t size)=0
 
void write (std::string_view s)
 
void write (const Blob &blob)
 
- Public Member Functions inherited from OutputStream
virtual ~OutputStream ()
 
virtual void write (const void *data, size_t size)=0
 
void write (std::string_view s)
 
void write (const Blob &blob)
 
virtual void flush ()=0
 
virtual void close ()=0
 
virtual std::string displayPath () const =0
 

Private Attributes

std::string * _target = nullptr
 
std::string _displayPath
 

Constructor & Destructor Documentation

◆ StringOutputStream() [1/2]

StringOutputStream::StringOutputStream ( )
default

◆ StringOutputStream() [2/2]

StringOutputStream::StringOutputStream ( std::string *  target,
std::string_view  displayPath = {} 
)
explicit

◆ ~StringOutputStream()

StringOutputStream::~StringOutputStream ( )
virtual

Member Function Documentation

◆ close()

void StringOutputStream::close ( )
overridevirtual

Closes this output stream. Writing into or flushing a closed stream will result in undefined behavior.

Does nothing if the stream is already closed.

Exceptions
ExceptionOn error.

Implements OutputStream.

Reimplemented in detail::MemoryFileSystemOutputStream, and BlobOutputStream.

◆ displayPath()

std::string StringOutputStream::displayPath ( ) const
overridevirtual
Returns
Path to the file or resource being written, to be used for debugging and error reporting.

Implements OutputStream.

Reimplemented in BlobOutputStream.

◆ flush()

void StringOutputStream::flush ( )
overridevirtual

Flushes this output stream if it provides any kind of buffering.

Exceptions
ExceptionOn error.

Implements OutputStream.

Reimplemented in BlobOutputStream.

◆ open()

void StringOutputStream::open ( std::string *  target,
std::string_view  displayPath = {} 
)

◆ write() [1/4]

void OutputStream::write ( const Blob blob)
inline

Writes provided Blob into the output stream.

Parameters
blobBlob to write.
Exceptions
ExceptionOn error.

◆ write() [2/4]

void StringOutputStream::write ( const void *  data,
size_t  size 
)
overridevirtual

Writes provided data into the output stream.

Parameters
dataPointer to the data to write.
sizeData size.
Exceptions
ExceptionOn error.

Implements OutputStream.

◆ write() [3/4]

virtual void OutputStream::write ( const void *  data,
size_t  size 
)
virtual

Writes provided data into the output stream.

Parameters
dataPointer to the data to write.
sizeData size.
Exceptions
ExceptionOn error.

Implements OutputStream.

◆ write() [4/4]

void OutputStream::write ( std::string_view  s)
inline

Writes provided string into the output stream.

Parameters
sString to write.
Exceptions
ExceptionOn error.

Member Data Documentation

◆ _displayPath

std::string StringOutputStream::_displayPath
private

◆ _target

std::string* StringOutputStream::_target = nullptr
private

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