|
CeresEngine 0.2.0
A game development framework
|
#include <CeresEngine/Foundation/IO/Stream.hpp>
Public Member Functions | |
| virtual bool | isWritable () const noexcept |
| Checks if the stream is writable. | |
| virtual Async< size_t > | write (const void *data, size_t n) |
Writes data tp the data stream from a buffer of raw memory data with length n. | |
| virtual Async< size_t > | writeExactly (void *data, size_t n) |
Similar to write(const void*, size_t), but ensures that the entire data buffer is written with exactly n bytes or up to the end of the data stream. | |
Public Member Functions inherited from CeresEngine::IAsyncStream | |
| virtual | ~IAsyncStream ()=default |
| Default virtual destructor. | |
| virtual bool | isSeekable (Seek mode=Seek::Start) const noexcept |
| Checks if the stream is seekable. | |
| virtual Async | seek (std::streamsize position, Seek mode=Seek::Start) |
| Changes the position of the data stream. | |
| Async | skip (const size_t n) |
Skips n bytes from the data stream. | |
| virtual bool | isTellable () const noexcept |
| Checks if the stream knows the size of the data. | |
| virtual Async< size_t > | tell () |
| Gets the number of bytes available on the stream. | |
| virtual bool | isSizeKnown () const noexcept |
| Checks if the stream knows the size of the data. | |
| virtual Async< size_t > | size () |
| Gets the number of bytes available on the stream. | |
| virtual Async | wait ()=0 |
| Waits until all pending operations on the stream are complete. | |
Additional Inherited Members | |
Public Types inherited from CeresEngine::IAsyncStream | |
| using | Seek = IStream::Seek |
| An enumeration that describes how a data stream should be seeked. | |
Checks if the stream is writable.
If this method returns true, write() is safe to be called on this stream.
Reimplemented in CeresEngine::SyncDataStreamAdapter.
|
virtual |
Writes data tp the data stream from a buffer of raw memory data with length n.
isWritable() returns true.| data | The memory location to which written data should be copied from. |
| n | The maximum number of bytes to be write to the data stream. |
n, in that case the write operation must be repeated to ensure that all data was written. If 0, indicates that the stream has ended. Reimplemented in CeresEngine::SyncDataStreamAdapter.
|
virtual |
Similar to write(const void*, size_t), but ensures that the entire data buffer is written with exactly n bytes or up to the end of the data stream.