#include <StdOutputStream.h>
|
| StdOutputStream ()=default |
|
| StdOutputStream (std::unique_ptr< std::ostream > stream) |
|
| StdOutputStream (StdOutputStream &&other) noexcept |
|
void | write (std::size_t numBytes, const std::byte *bytes) override |
| Write data in the form of raw bytes in one go. The method does not return before finishing the writing process.
|
|
void | writeString (std::string_view str) override |
| Write a string in one go.
|
|
void | seekPut (std::size_t pos) override |
| Set the output position of the stream. The unit of the position is defined by the implementation.
|
|
std::optional< std::size_t > | tellPut () override |
| Get the current output position of the stream. The unit of the position is defined by the implementation.
|
|
| operator bool () const override |
|
std::ostream * | getStream () const |
|
StdOutputStream & | operator= (StdOutputStream &&rhs) noexcept |
|
virtual std::size_t | writeSome (std::size_t numBytes, const std::byte *bytes) |
| Write some data in the form of raw bytes. The method may return before finish writing all bytes. In such case, the method returns how many bytes were actually written.
|
|
void | writeLine (std::string_view str) |
| Write a line. Equivalent to calling writeString(std::string_view) with '
' as an extra character.
|
|
virtual | ~IDataStream ()=default |
|
virtual std::string | acquireName () const |
| Access to the stream's name. This method is not meant to be used in a high performance context, unless otherwise stated by the overridder. Stream name is not always available.
|
|
◆ StdOutputStream() [1/3]
ph::StdOutputStream::StdOutputStream |
( |
| ) |
|
|
default |
◆ StdOutputStream() [2/3]
ph::StdOutputStream::StdOutputStream |
( |
std::unique_ptr< std::ostream > | stream | ) |
|
|
explicit |
◆ StdOutputStream() [3/3]
◆ ensureStreamIsGoodForWrite()
void ph::StdOutputStream::ensureStreamIsGoodForWrite |
( |
| ) |
const |
|
protected |
Check if the stream has any error.
- Exceptions
-
IOException | If there is any error. |
◆ getReasonForError()
std::string ph::StdOutputStream::getReasonForError |
( |
| ) |
const |
|
protected |
A description for why the stream is not in a good state.
◆ getStream()
std::ostream * ph::StdOutputStream::getStream |
( |
| ) |
const |
|
inline |
◆ isStreamGoodForWrite()
bool ph::StdOutputStream::isStreamGoodForWrite |
( |
| ) |
const |
|
inlineprotected |
◆ operator bool()
ph::StdOutputStream::operator bool |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ operator=()
◆ seekPut()
void ph::StdOutputStream::seekPut |
( |
std::size_t | pos | ) |
|
|
overridevirtual |
Set the output position of the stream. The unit of the position is defined by the implementation.
- Exceptions
-
IOException | If the seeking process failed. |
Implements ph::IOutputStream.
◆ tellPut()
std::optional< std::size_t > ph::StdOutputStream::tellPut |
( |
| ) |
|
|
overridevirtual |
Get the current output position of the stream. The unit of the position is defined by the implementation.
- Returns
- Current output position. Empty if the position is unavailable.
Implements ph::IOutputStream.
◆ write()
void ph::StdOutputStream::write |
( |
std::size_t | numBytes, |
|
|
const std::byte * | bytes ) |
|
overridevirtual |
Write data in the form of raw bytes in one go. The method does not return before finishing the writing process.
- Exceptions
-
IOException | If the write operation failed. |
Implements ph::IOutputStream.
◆ writeString()
void ph::StdOutputStream::writeString |
( |
std::string_view | str | ) |
|
|
overridevirtual |
Write a string in one go.
- Parameters
-
- Exceptions
-
IOException | If the write operation failed. |
Implements ph::IOutputStream.
The documentation for this class was generated from the following files: