#include <IOutputStream.h>
|
| virtual void | write (std::size_t numBytes, const std::byte *bytes)=0 |
| | Write data in the form of raw bytes in one go. The method does not return before finishing the writing process.
|
| |
| virtual void | writeString (std::string_view str)=0 |
| | Write a string in one go.
|
| |
| virtual void | seekPut (std::size_t pos)=0 |
| | Set the output position of the stream. The unit of the position is defined by the implementation.
|
| |
| virtual std::optional< std::size_t > | tellPut ()=0 |
| | Get the current output position of the stream. The unit of the position is defined by the implementation.
|
| |
| | operator bool () const override=0 |
| |
| 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.
|
| |
◆ operator bool()
| ph::IOutputStream::operator bool |
( |
| ) |
const |
|
overridepure virtual |
◆ seekPut()
| virtual void ph::IOutputStream::seekPut |
( |
std::size_t | pos | ) |
|
|
pure virtual |
Set the output position of the stream. The unit of the position is defined by the implementation.
- Exceptions
-
| IOException | If the seeking process failed. |
Implemented in ph::StdOutputStream.
◆ tellPut()
| virtual std::optional< std::size_t > ph::IOutputStream::tellPut |
( |
| ) |
|
|
pure virtual |
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.
Implemented in ph::StdOutputStream.
◆ write()
| virtual void ph::IOutputStream::write |
( |
std::size_t | numBytes, |
|
|
const std::byte * | bytes ) |
|
pure virtual |
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. |
Implemented in ph::StdOutputStream.
◆ writeLine()
| void ph::IOutputStream::writeLine |
( |
std::string_view | str | ) |
|
|
inline |
Write a line. Equivalent to calling writeString(std::string_view) with '
' as an extra character.
- Parameters
-
| str | The written string. Ideally should not include the new-line character. |
- Exceptions
-
| IOException | If the write operation failed. |
◆ writeSome()
| std::size_t ph::IOutputStream::writeSome |
( |
std::size_t | numBytes, |
|
|
const std::byte * | bytes ) |
|
inlinevirtual |
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.
- Returns
- How many bytes were actually written.
- Exceptions
-
| IOException | If the write operation failed. |
◆ writeString()
| virtual void ph::IOutputStream::writeString |
( |
std::string_view | str | ) |
|
|
pure virtual |
The documentation for this class was generated from the following file: