OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
OutputStream Class Referenceabstract

#include <OutputStream.h>

Inheritance diagram for OutputStream:
FileOutputStream StringOutputStream BlobOutputStream detail::MemoryFileSystemOutputStream

Public Member Functions

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
 

Detailed Description

Abstract base class for all data output streams.

Compared to std::ostream it is:

Constructor & Destructor Documentation

◆ ~OutputStream()

virtual OutputStream::~OutputStream ( )
inlinevirtual

Member Function Documentation

◆ close()

virtual void OutputStream::close ( )
pure virtual

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.

Implemented in detail::MemoryFileSystemOutputStream, BlobOutputStream, FileOutputStream, and StringOutputStream.

◆ displayPath()

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

Implemented in BlobOutputStream, FileOutputStream, and StringOutputStream.

◆ flush()

virtual void OutputStream::flush ( )
pure virtual

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

Exceptions
ExceptionOn error.

Implemented in BlobOutputStream, FileOutputStream, and StringOutputStream.

◆ write() [1/3]

void OutputStream::write ( const Blob blob)
inline

Writes provided Blob into the output stream.

Parameters
blobBlob to write.
Exceptions
ExceptionOn error.

◆ write() [2/3]

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

Writes provided data into the output stream.

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

Implemented in FileOutputStream, StringOutputStream, FileOutputStream, and StringOutputStream.

◆ write() [3/3]

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

Writes provided string into the output stream.

Parameters
sString to write.
Exceptions
ExceptionOn error.

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