![]() |
Gamedev Framework (gf)
0.14.0
A C++14 framework for 2D games
|
File based output stream. More...
#include <gf/Streams.h>
Public Types | |
enum | Mode { Mode::Write, Mode::Append } |
Open mode for the file. More... | |
Public Member Functions | |
FileOutputStream (const Path &path, Mode mode=Mode::Write) | |
Constructor. More... | |
~FileOutputStream () | |
Destructor. More... | |
std::size_t | write (ArrayRef< uint8_t > buffer) override |
Write data to the stream. More... | |
std::size_t | getWrittenBytesCount () const override |
Get the number of bytes already written. More... | |
![]() | |
OutputStream ()=default | |
Default constructor. More... | |
OutputStream (const InputStream &)=delete | |
Deleted copy constructor. More... | |
OutputStream & | operator= (const InputStream &)=delete |
Deleted copy assignment. More... | |
virtual | ~OutputStream () |
Destructor. More... | |
std::size_t | write (uint8_t byte) |
Write a single byte to the stream. More... | |
File based output stream.
|
strong |
gf::FileOutputStream::FileOutputStream | ( | const Path & | path, |
Mode | mode = Mode::Write |
||
) |
Constructor.
The constructor opens the file. If the file is not opened, an exception is thrown.
path | The path to the file |
mode | The open mode of the file |
gf::FileOutputStream::~FileOutputStream | ( | ) |
Destructor.
The destructor closes the file.
|
overridevirtual |
Get the number of bytes already written.
This function returns the number of bytes actually written i.e. it does not take into account possible bytes that have not been flushed yet.
Implements gf::OutputStream.
|
overridevirtual |
Write data to the stream.
buffer | The buffer to copy to the stream |
Implements gf::OutputStream.