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

#include <FileOutputStream.h>

Inheritance diagram for FileOutputStream:
OutputStream

Public Member Functions

 FileOutputStream ()=default
 
 FileOutputStream (std::string_view path)
 
virtual ~FileOutputStream ()
 
void open (std::string_view path)
 
bool isOpen () const
 
virtual void write (const void *data, size_t size) override
 
virtual void flush () override
 
virtual void close () override
 
virtual std::string displayPath () const override
 
FILE * handle ()
 
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 Member Functions

void closeInternal (bool canThrow)
 

Private Attributes

std::string _path
 
FILE * _file = nullptr
 

Constructor & Destructor Documentation

◆ FileOutputStream() [1/2]

FileOutputStream::FileOutputStream ( )
default

◆ FileOutputStream() [2/2]

FileOutputStream::FileOutputStream ( std::string_view  path)
explicit

◆ ~FileOutputStream()

FileOutputStream::~FileOutputStream ( )
virtual

Member Function Documentation

◆ close()

void FileOutputStream::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.

◆ closeInternal()

void FileOutputStream::closeInternal ( bool  canThrow)
private

◆ displayPath()

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

Implements OutputStream.

◆ flush()

void FileOutputStream::flush ( )
overridevirtual

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

Exceptions
ExceptionOn error.

Implements OutputStream.

◆ handle()

FILE * FileOutputStream::handle ( )
inline

◆ isOpen()

bool FileOutputStream::isOpen ( ) const
inline

◆ open()

void FileOutputStream::open ( std::string_view  path)

◆ 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 FileOutputStream::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

◆ _file

FILE* FileOutputStream::_file = nullptr
private

◆ _path

std::string FileOutputStream::_path
private

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