A Stream guaranteed to not throw exceptions.
More...
#include <Stream.hpp>
|
virtual unsigned long long | CursorPosition (void) const noexcept=0 |
| Get the current position of the read/write cursor in the Stream. Equivalent of Seek(0, SeekLocation::CURSOR) More...
|
|
virtual unsigned long long | Seek (const long long AOffset, const SeekLocation ALocation) const noexcept=0 |
| Set the cursor position in the Stream. More...
|
|
virtual unsigned long long | Read (void *const ABuffer, const unsigned long long AMaxAmount) const noexcept=0 |
| Read data from a Stream at the current cursor position and advance the cursor by that amount. More...
|
|
virtual unsigned long long | Write (const void *const ABuffer, const unsigned long long AAmount) noexcept=0 |
| Write data to the Stream at the current cursor position and advance the cursor by that amount. More...
|
|
virtual void | Capabilities (Mode &AMode, bool &ASeek) const noexcept=0 |
| Get the capabilities of the stream. More...
|
|
A Stream guaranteed to not throw exceptions.
- Attention
- As a result, invalid operations will result in calls to HCF
Definition at line 79 of file Stream.hpp.
virtual unsigned long long CYB::API::SafeStream::CursorPosition |
( |
void |
| ) |
const |
|
pure virtualnoexcept |
Get the current position of the read/write cursor in the Stream. Equivalent of Seek(0, SeekLocation::CURSOR)
- Returns
- The current position of the cursor in the Stream
- Thread Safety
- This function requires synchronization at the object level
Implements CYB::API::Stream.
virtual unsigned long long CYB::API::SafeStream::Read |
( |
void *const |
ABuffer, |
|
|
const unsigned long long |
AMaxAmount |
|
) |
| const |
|
pure virtualnoexcept |
Read data from a Stream at the current cursor position and advance the cursor by that amount.
- Parameters
-
[out] | ABuffer | The location to store the read data |
| AMaxAmount | The maximum number of bytes to be read |
- Returns
- The number of bytes read. If zero is returned, and the cursor position is not as SeekLocation::END an error has occurred and the read should not be retried
- Thread Safety
- This function requires synchronization at the object level
Implements CYB::API::Stream.
virtual unsigned long long CYB::API::SafeStream::Seek |
( |
const long long |
AOffset, |
|
|
const SeekLocation |
ALocation |
|
) |
| const |
|
pure virtualnoexcept |
Set the cursor position in the Stream.
- Parameters
-
AOffset | The offset from ALocation to set the cursor to |
ALocation | The initial location to begin the offset |
- Returns
- The current cursor position
- Thread Safety
- This function requires synchronization at the object level
Implements CYB::API::Stream.
virtual unsigned long long CYB::API::SafeStream::Write |
( |
const void *const |
ABuffer, |
|
|
const unsigned long long |
AAmount |
|
) |
| |
|
pure virtualnoexcept |
Write data to the Stream at the current cursor position and advance the cursor by that amount.
- Parameters
-
ABuffer | The location to get the data to write |
AAmount | The number of bytes to be written |
- Returns
- The number of bytes written. If zero is returned, an error has occurred and the write should not be retried
- Thread Safety
- This function requires synchronization at the object level
Implements CYB::API::Stream.
The documentation for this class was generated from the following file: