|
CeresEngine 0.2.0
A game development framework
|
A helper data stream that allows filtering the results of another data stream. More...
#include <CeresEngine/Foundation/IO/Stream.Filtered.hpp>
Public Member Functions | |
| FilteredOutputStream (OutputStream &&outputStream) | |
| Creates a new filtered data stream. | |
| FilteredOutputStream (FilteredOutputStream &&) noexcept=default | |
| ~FilteredOutputStream () override=default | |
| OutputStream & | getOutputStream () noexcept |
| The data stream being filtered. | |
| const OutputStream & | getOutputStream () const noexcept |
| The data stream being filtered. | |
| bool | isSeekable (const Seek mode=Seek::Start) const noexcept override |
| Checks if the stream is seekable. | |
| void | seek (const std::streamsize position, const Seek mode=Seek::Start) override |
| Changes the position of the data stream. | |
| bool | isTellable () const noexcept override |
| Checks if the stream knows it's current absolute position. | |
| size_t | tell () override |
| Gets the absolute stream position, in bytes. | |
| bool | isSizeKnown () const noexcept override |
| Checks if the stream knows the size of the data. | |
| size_t | size () override |
| Gets the number of bytes available on the stream. | |
| bool | isWritable () const noexcept override |
| Checks if the stream is writable. | |
| size_t | write (const void *data, const size_t n) override |
Writes data to the data stream from a buffer of raw memory data with length n. | |
| bool | flush () override |
| In the stream is buffered, invalidates any buffered write data from to stream. | |
| virtual size_t | write (const void *data, size_t n) |
Writes data to the data stream from a buffer of raw memory data with length n. | |
| template<typename T > | |
| size_t | write (const MemoryView< const T > &memoryView) |
| Writes data from a memory view to the stream. | |
| template<typename T > | |
| size_t | write (const StridedMemoryView< const T > &memoryView) |
| Writes data from a strided memory view to the stream. | |
| template<typename T > requires std::is_trivially_copyable_v<T> | |
| bool | write (T value) |
| Writes a trivially copyable object to the stream. | |
Public Member Functions inherited from CeresEngine::IOutputStream | |
| template<typename T > | |
| size_t | write (const MemoryView< const T > &memoryView) |
| Writes data from a memory view to the stream. | |
| template<typename T > | |
| size_t | write (const StridedMemoryView< const T > &memoryView) |
| Writes data from a strided memory view to the stream. | |
| size_t | writeString (const StringView string) |
| Writes a string to the data stream. | |
| template<typename T > requires std::is_trivially_copyable_v<T> | |
| bool | write (T value) |
| Writes a trivially copyable object to the stream. | |
Public Member Functions inherited from CeresEngine::IStream | |
| IStream ()=default | |
| IStream (const IStream &) noexcept=delete | |
| IStream & | operator= (const IStream &) noexcept=delete |
| IStream (IStream &&) noexcept=default | |
| IStream & | operator= (IStream &&) noexcept=default |
| virtual | ~IStream () noexcept=default |
| void | skip (const size_t n) |
Skips n bytes from the data stream. | |
Protected Attributes | |
| OutputStream | mOutputStream |
| The data stream being filtered. | |
Additional Inherited Members | |
Public Types inherited from CeresEngine::IStream | |
| enum class | Seek { Start = SEEK_SET , Current = SEEK_CUR , End = SEEK_END } |
| An enumeration that describes how a data stream should be seeked. More... | |
A helper data stream that allows filtering the results of another data stream.
|
inlineexplicit |
Creates a new filtered data stream.
|
defaultnoexcept |
|
overridedefault |
|
inlineoverridevirtual |
In the stream is buffered, invalidates any buffered write data from to stream.
Non-buffered streams are free to ignore this method.
Reimplemented from CeresEngine::IOutputStream.
|
inlinenoexcept |
The data stream being filtered.
|
inlinenoexcept |
The data stream being filtered.
|
inlineoverridevirtualnoexcept |
Checks if the stream is seekable.
If this method returns true, seek() is safe to be called on this stream.
Reimplemented from CeresEngine::IStream.
|
inlineoverridevirtualnoexcept |
Checks if the stream knows the size of the data.
If this method returns true, size() is safe to be called on this stream.
Reimplemented from CeresEngine::IStream.
|
inlineoverridevirtualnoexcept |
Checks if the stream knows it's current absolute position.
If this method returns true, tell() is safe to be called on this stream.
Reimplemented from CeresEngine::IStream.
|
inlineoverridevirtualnoexcept |
Checks if the stream is writable.
If this method returns true, write() is safe to be called on this stream.
Reimplemented from CeresEngine::IOutputStream.
|
inlineoverridevirtual |
Changes the position of the data stream.
isSeekable() returns true.| position | The position to set the data stream to. |
| mode | The mode to change the data stream position. |
Reimplemented from CeresEngine::IStream.
|
inlineoverridevirtual |
Gets the number of bytes available on the stream.
isSizeKnown() returns true. Reimplemented from CeresEngine::IStream.
|
inlineoverridevirtual |
Gets the absolute stream position, in bytes.
isTellable() returns true. Reimplemented from CeresEngine::IStream.
|
inline |
Writes data from a memory view to the stream.
| memoryView | The memory view to read data to. |
n. If 0, indicates that the stream has ended.
|
inline |
Writes data from a strided memory view to the stream.
Data is written sequentially from the stream, but is read respecting the striding requirements of the view.
| memoryView | The memory view to read data to. |
n. If 0, indicates that the stream has ended.
|
inlineoverridevirtual |
Writes data to 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 from CeresEngine::IOutputStream.
Writes data to 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 from CeresEngine::IOutputStream.
Writes a trivially copyable object to the stream.
| T | The trivially copyable object type to be written. |
| value | The trivially copyable object value to be written. |
|
protected |
The data stream being filtered.