|
StormByte C++ Library: Buffer module 0.0.9999
StormByte-Buffer is a StormByte library module for handling buffers
|
Byte-oriented FIFO buffer with grow-on-demand. More...
#include <fifo.hxx>


Public Member Functions | |
| FIFO () noexcept=default | |
| Construct FIFO. | |
| FIFO (const DataType &data) noexcept | |
| Construct FIFO with initial data. | |
| FIFO (DataType &&data) noexcept | |
| Construct FIFO with initial data using move semantics. | |
| template<std::ranges::input_range R> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<R>>>) && requires(std::ranges::range_value_t<R> v) { static_cast<std::byte>(v); } && (!std::same_as<std::remove_cvref_t<R>, DataType>) | |
| FIFO (const R &r) noexcept | |
| Construct FIFO from an input range. | |
| template<std::ranges::input_range Rr> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Rr>>>) && requires(std::ranges::range_value_t<Rr> v) { static_cast<std::byte>(v); } | |
| FIFO (Rr &&r) noexcept | |
| Construct FIFO from an rvalue range (moves when DataType rvalue). | |
| FIFO (std::string_view sv) noexcept | |
| Construct FIFO from a string view (does not include terminating NUL). | |
| FIFO (const char *s) noexcept | |
| Construct FIFO from a C string pointer (null-terminated). | |
| FIFO (const FIFO &other) noexcept | |
| Copy construct, preserving buffer state and initial capacity. | |
| FIFO (FIFO &&other) noexcept | |
| Move construct, preserving buffer state and initial capacity. | |
| virtual | ~FIFO () noexcept=default |
| Virtual destructor. | |
| FIFO & | operator= (const FIFO &other) |
| Copy assign, preserving buffer state and initial capacity. | |
| FIFO & | operator= (FIFO &&other) noexcept |
| Move assign, preserving buffer state and initial capacity. | |
| bool | operator== (const FIFO &other) const noexcept |
| Equality comparison. | |
| bool | operator!= (const FIFO &other) const noexcept |
| Inequality comparison. | |
| virtual std::size_t | AvailableBytes () const noexcept |
| Get the number of bytes available for reading. | |
| virtual void | Clean () noexcept override |
| Clean buffer data (from start to readposition) | |
| virtual void | Clear () noexcept override |
| Clear all buffer contents. | |
| virtual const DataType & | Data () const noexcept override |
| Access the internal data buffer. | |
| virtual bool | Drop (const std::size_t &count) noexcept override |
| Drop bytes in the buffer and updates read position. | |
| virtual bool | Empty () const noexcept override |
| Check if the buffer is empty. | |
| virtual bool | EoF () const noexcept override |
| Check if the reader has reached end-of-file. | |
| bool | Extract (const std::size_t &count, DataType &outBuffer) noexcept override |
| Destructive read that removes data from the buffer into an existing vector. | |
| bool | Extract (const std::size_t &count, WriteOnly &outBuffer) noexcept override |
| Destructive read that removes data from the buffer into a FIFO. | |
| void | ExtractUntilEoF (DataType &outBuffer) noexcept override |
| Read all bytes until end-of-file into an existing buffer. | |
| void | ExtractUntilEoF (WriteOnly &outBuffer) noexcept override |
| Read all bytes until end-of-file into a WriteOnly buffer. | |
| virtual std::string | HexDump (const std::size_t &collumns=16, const std::size_t &byte_limit=0) const noexcept |
| Produce a hexdump of the unread contents starting at the current read position. | |
| virtual bool | IsReadable () const noexcept override |
| Check if the buffer is readable. | |
| virtual bool | IsWritable () const noexcept override |
| Check if the buffer is writable. | |
| bool | Peek (const std::size_t &count, DataType &outBuffer) const noexcept override |
| Non-destructive peek at buffer data without advancing read position. | |
| bool | Peek (const std::size_t &count, WriteOnly &outBuffer) const noexcept override |
| Non-destructive peek at buffer data without advancing read position. | |
| bool | Read (const std::size_t &count, DataType &outBuffer) const noexcept override |
| Non destructive read that removes data from the buffer into an existing vector. | |
| bool | Read (const std::size_t &count, WriteOnly &outBuffer) const noexcept override |
| Destructive read that removes data from the buffer into a vector. | |
| void | ReadUntilEoF (DataType &outBuffer) const noexcept override |
| Read all bytes until end-of-file into an existing buffer. | |
| void | ReadUntilEoF (WriteOnly &outBuffer) const noexcept override |
| Read all bytes until end-of-file into a WriteOnly buffer. | |
| virtual void | Seek (const std::ptrdiff_t &offset, const Position &mode) const noexcept override |
| Move the read position for non-destructive reads. | |
| virtual std::size_t | Size () const noexcept override |
| Get the current number of bytes stored in the buffer. | |
| bool | Write (const std::size_t &count, const DataType &data) noexcept override |
| Write bytes from a vector to the buffer. | |
| bool | Write (const std::size_t &count, DataType &&data) noexcept override |
| Move bytes from a vector to the buffer. | |
| bool | Write (const std::size_t &count, const ReadOnly &data) noexcept override |
| Write bytes from a vector to the buffer. | |
| bool | Write (const std::size_t &count, ReadOnly &&data) noexcept override |
| Move bytes from a vector to the buffer. | |
| virtual bool | Extract (const std::size_t &count, DataType &outBuffer) noexcept=0 |
| bool | Extract (DataType &outBuffer) noexcept |
| virtual bool | Extract (const std::size_t &count, WriteOnly &outBuffer) noexcept=0 |
| bool | Extract (WriteOnly &outBuffer) noexcept |
| virtual bool | Read (const std::size_t &count, DataType &outBuffer) const noexcept=0 |
| bool | Read (DataType &outBuffer) const noexcept |
| virtual bool | Read (const std::size_t &count, WriteOnly &outBuffer) const noexcept=0 |
| bool | Read (WriteOnly &outBuffer) const noexcept |
| virtual bool | Write (const std::size_t &count, const DataType &data) noexcept=0 |
| bool | Write (std::string_view sv) noexcept |
| bool | Write (const char *s) noexcept |
| bool | Write (const std::size_t &count, std::string_view sv) noexcept |
| bool | Write (const std::size_t &count, const char *s) noexcept |
| template<std::size_t N> | |
| bool | Write (const char(&s)[N]) noexcept |
| template<std::ranges::input_range R> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<R>>>) && requires(std::ranges::range_value_t<R> v) { static_cast<std::byte>(v); } | |
| bool | Write (const R &r) noexcept |
| template<std::ranges::input_range Rw> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Rw>>>) && requires(std::ranges::range_value_t<Rw> v) { static_cast<std::byte>(v); } | |
| bool | Write (const std::size_t &count, const Rw &r) noexcept |
| template<std::ranges::input_range Rrw> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Rrw>>>) && requires(std::ranges::range_value_t<Rrw> v) { static_cast<std::byte>(v); } | |
| bool | Write (const std::size_t &count, Rrw &&r) noexcept |
| template<std::ranges::input_range Rr> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Rr>>>) && requires(std::ranges::range_value_t<Rr> v) { static_cast<std::byte>(v); } | |
| bool | Write (Rr &&r) noexcept |
| template<std::input_iterator I, std::sentinel_for< I > S> requires (!std::is_class_v<std::remove_cv_t<std::iter_value_t<I>>>) && requires(std::iter_value_t<I> v) { static_cast<std::byte>(v); } | |
| bool | Write (I first, S last) noexcept |
| template<std::input_iterator I2, std::sentinel_for< I2 > S2> requires (!std::is_class_v<std::remove_cv_t<std::iter_value_t<I2>>>) && requires(std::iter_value_t<I2> v) { static_cast<std::byte>(v); } | |
| bool | Write (const std::size_t &count, I2 first, S2 last) noexcept |
| virtual bool | Write (const std::size_t &count, DataType &&data) noexcept=0 |
| virtual bool | Write (const std::size_t &count, const ReadOnly &data) noexcept=0 |
| bool | Write (const ReadOnly &data) noexcept |
| virtual bool | Write (const std::size_t &count, ReadOnly &&data) noexcept=0 |
| bool | Write (ReadOnly &&data) noexcept |
Public Member Functions inherited from StormByte::Buffer::ReadWrite | |
| ReadWrite () noexcept | |
| Construct ReadWrite. | |
| ReadWrite (const DataType &data) noexcept | |
| Construct ReadWrite. | |
| ReadWrite (DataType &&data) noexcept | |
| Construct ReadWrite with initial data using move semantics. | |
| ReadWrite (const ReadWrite &other) noexcept=default | |
| Copy construct deleted. | |
| ReadWrite (ReadWrite &&other) noexcept=default | |
| Move construct deleted. | |
| virtual | ~ReadWrite () noexcept=default |
| Virtual destructor. | |
| ReadWrite & | operator= (const ReadWrite &other)=default |
| Copy assign deleted. | |
| ReadWrite & | operator= (ReadWrite &&other) noexcept=default |
| Move assign deleted. | |
Public Member Functions inherited from StormByte::Buffer::ReadOnly | |
| ReadOnly () noexcept | |
| Construct ReadOnly. | |
| ReadOnly (const DataType &data) noexcept | |
| Construct ReadOnly. | |
| ReadOnly (DataType &&data) noexcept | |
| Construct ReadOnly with initial data using move semantics. | |
| ReadOnly (const ReadOnly &) noexcept=default | |
| Copy construct deleted. | |
| ReadOnly (ReadOnly &&) noexcept=default | |
| Move construct deleted. | |
| virtual | ~ReadOnly () noexcept=default |
| Virtual destructor. | |
| ReadOnly & | operator= (const ReadOnly &)=default |
| Copy assign deleted. | |
| ReadOnly & | operator= (ReadOnly &&) noexcept=default |
| Move assign deleted. | |
| bool | Extract (DataType &outBuffer) noexcept |
| Destructive read that removes all data from the buffer into an existing vector. | |
| bool | Extract (WriteOnly &outBuffer) noexcept |
| Destructive read that removes all data from the buffer into a FIFO. | |
| bool | Read (DataType &outBuffer) const noexcept |
| Read bytes into an existing buffer. | |
| bool | Read (WriteOnly &outBuffer) const noexcept |
| Read bytes into a WriteOnly buffer. | |
Public Member Functions inherited from StormByte::Buffer::Generic | |
| Generic () noexcept=default | |
| Construct Generic. | |
| Generic (const DataType &data) noexcept | |
| Construct Generic. | |
| Generic (DataType &&data) noexcept | |
| Construct Generic with initial data using move semantics. | |
| Generic (const Generic &) noexcept=default | |
| Copy construct deleted. | |
| Generic (Generic &&) noexcept=default | |
| Move construct deleted. | |
| virtual | ~Generic () noexcept=0 |
| Virtual destructor. | |
| Generic & | operator= (const Generic &other)=default |
| Copy assign deleted. | |
| Generic & | operator= (Generic &&) noexcept=default |
| Move assign deleted. | |
Public Member Functions inherited from StormByte::Buffer::WriteOnly | |
| WriteOnly () noexcept | |
| Construct WriteOnly. | |
| WriteOnly (const DataType &data) noexcept | |
| Construct WriteOnly. | |
| WriteOnly (DataType &&data) noexcept | |
| Construct WriteOnly with initial data using move semantics. | |
| WriteOnly (const WriteOnly &)=default | |
| Copy construct deleted. | |
| WriteOnly (WriteOnly &&) noexcept=default | |
| Move construct deleted. | |
| virtual | ~WriteOnly () noexcept=default |
| Virtual destructor. | |
| WriteOnly & | operator= (const WriteOnly &)=default |
| Copy assign deleted. | |
| WriteOnly & | operator= (WriteOnly &&) noexcept=default |
| Move assign deleted. | |
| bool | Write (std::string_view sv) noexcept |
| Write from a string view (does not include terminating NUL). | |
| bool | Write (const char *s) noexcept |
Write from a C string pointer (null-terminated). Uses std::string_view. | |
| bool | Write (const std::size_t &count, std::string_view sv) noexcept |
Write up-to count bytes from a string view (0 => all available). | |
| bool | Write (const std::size_t &count, const char *s) noexcept |
Write up-to count bytes from a C string pointer (null-terminated). | |
| template<std::size_t N> | |
| bool | Write (const char(&s)[N]) noexcept |
| Write from a string literal (array) and avoid copying the trailing NUL. | |
| template<std::ranges::input_range R> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<R>>>) && requires(std::ranges::range_value_t<R> v) { static_cast<std::byte>(v); } | |
| bool | Write (const R &r) noexcept |
| Write all elements from an input range to the buffer. | |
| template<std::ranges::input_range Rw> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Rw>>>) && requires(std::ranges::range_value_t<Rw> v) { static_cast<std::byte>(v); } | |
| bool | Write (const std::size_t &count, const Rw &r) noexcept |
Write up-to count elements from an input range. | |
| template<std::ranges::input_range Rrw> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Rrw>>>) && requires(std::ranges::range_value_t<Rrw> v) { static_cast<std::byte>(v); } | |
| bool | Write (const std::size_t &count, Rrw &&r) noexcept |
Write up-to count elements from an rvalue range. | |
| template<std::ranges::input_range Rr> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Rr>>>) && requires(std::ranges::range_value_t<Rr> v) { static_cast<std::byte>(v); } | |
| bool | Write (Rr &&r) noexcept |
| Write from an rvalue input range. | |
| template<std::input_iterator I, std::sentinel_for< I > S> requires (!std::is_class_v<std::remove_cv_t<std::iter_value_t<I>>>) && requires(std::iter_value_t<I> v) { static_cast<std::byte>(v); } | |
| bool | Write (I first, S last) noexcept |
Write from iterator pair whose value_type is convertible to std::byte. | |
| template<std::input_iterator I2, std::sentinel_for< I2 > S2> requires (!std::is_class_v<std::remove_cv_t<std::iter_value_t<I2>>>) && requires(std::iter_value_t<I2> v) { static_cast<std::byte>(v); } | |
| bool | Write (const std::size_t &count, I2 first, S2 last) noexcept |
Write up-to count bytes from an iterator pair (0 => all available). | |
| bool | Write (const ReadOnly &data) noexcept |
| Write bytes from a vector to the buffer. | |
| bool | Write (ReadOnly &&data) noexcept |
| Move bytes from a vector to the buffer. | |
Protected Types | |
| enum class | Operation { Extract , Read , Peek } |
| Enumeration of read operation types. More... | |
Protected Member Functions | |
| virtual std::ostringstream | HexDumpHeader () const noexcept |
| Produce a hexdump header with size and read position. | |
| virtual bool | ReadInternal (const std::size_t &count, DataType &outBuffer, const Operation &flag) noexcept |
| Internal helper for read operations. | |
| virtual bool | ReadInternal (const std::size_t &count, WriteOnly &outBuffer, const Operation &flag) noexcept |
| Internal helper for read operations. | |
| virtual void | ReadUntilEoFInternal (DataType &outBuffer, const Operation &flag) noexcept |
| Internal helper for reading until end-of-file. | |
| virtual void | ReadUntilEoFInternal (WriteOnly &outBuffer, const Operation &flag) noexcept |
| Internal helper for reading until end-of-file. | |
| virtual bool | WriteInternal (const std::size_t &count, const DataType &src) noexcept |
| Internal helper for write operations. | |
| virtual bool | WriteInternal (const std::size_t &count, DataType &&src) noexcept |
| Internal helper for write operations. | |
| virtual bool | WriteInternal (const std::size_t &count, const ReadOnly &src) noexcept |
| Internal helper for write operations. | |
| virtual bool | WriteInternal (const std::size_t &count, ReadOnly &&src) noexcept |
| Internal helper for write operations. | |
Static Protected Member Functions | |
| static std::string | FormatHexLines (std::span< const std::byte > &data, std::size_t start_offset, std::size_t collumns) noexcept |
| Produce a hexdump of the given data span. | |
Static Protected Member Functions inherited from StormByte::Buffer::Generic | |
| template<std::ranges::input_range Src> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Src>>>) && requires(std::ranges::range_value_t<Src> v) { static_cast<std::byte>(v); } | |
| static DataType | DataConvert (const Src &src) noexcept |
Convert various source types into the library DataType. | |
|
template<std::ranges::input_range Src> requires (!std::is_class_v<std::remove_cv_t<std::ranges::range_value_t<Src>>>) && requires(std::ranges::range_value_t<Src> v) { static_cast<std::byte>(v); } | |
| static DataType | DataConvert (Src &&src) noexcept |
| static DataType | DataConvert (std::string_view sv) noexcept |
Convert a std::string_view to DataType. | |
| static DataType | DataConvert (const char *s) noexcept |
Convert a null-terminated C string to DataType. | |
Protected Attributes | |
| std::size_t | m_position_offset {0} |
| Current read position for read operations. | |
Protected Attributes inherited from StormByte::Buffer::Generic | |
| DataType | m_buffer |
| Internal buffer storage. | |
Byte-oriented FIFO buffer with grow-on-demand.
DataType that tracks a logical read position. It grows automatically to fit writes and supports efficient non-destructive reads and destructive extracts.
|
strongprotected |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Construct FIFO from an input range.
| R | Input range whose elements are convertible to std::byte. |
| r | The input range to copy from. |
DataType to avoid ambiguity with the existing DataType overloads.
|
inlinenoexcept |
Construct FIFO from an rvalue range (moves when DataType rvalue).
| Rr | Input range type; if it's DataType this will be moved into the internal buffer, otherwise elements are converted. |
|
noexcept |
Copy construct, preserving buffer state and initial capacity.
| other | Source FIFO to copy from. |
|
noexcept |
Move construct, preserving buffer state and initial capacity.
| other | Source FIFO to move from; left empty after move. |
|
inlinevirtualnoexcept |
Get the number of bytes available for reading.
Implements StormByte::Buffer::ReadOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
overridevirtualnoexcept |
Clean buffer data (from start to readposition)
Implements StormByte::Buffer::ReadOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
inlineoverridevirtualnoexcept |
Clear all buffer contents.
Removes all data from the buffer, resets head/tail/read positions, and restores capacity to the initial value requested in the constructor.
Implements StormByte::Buffer::ReadOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
inlineoverridevirtualnoexcept |
Access the internal data buffer.
Reimplemented from StormByte::Buffer::ReadOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
overridevirtualnoexcept |
Drop bytes in the buffer and updates read position.
| count | Number of bytes to drop. |
Implements StormByte::Buffer::ReadOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
inlineoverridevirtualnoexcept |
Check if the buffer is empty.
Implements StormByte::Buffer::ReadOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
inlineoverridevirtualnoexcept |
Check if the reader has reached end-of-file.
Returns true when the buffer has been closed or set to error and there are no available bytes remaining.
Implements StormByte::Buffer::ReadOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
inlineoverridevirtualnoexcept |
Destructive read that removes data from the buffer into an existing vector.
| count | Number of bytes to extract; 0 extracts all available. |
| outBuffer | Vector to fill with extracted bytes; resized as needed. |
Implements StormByte::Buffer::ReadOnly.
|
inlinevirtualnoexcept |
Expose the rest of overloads
Implements StormByte::Buffer::ReadOnly.
|
inlineoverridevirtualnoexcept |
Destructive read that removes data from the buffer into a FIFO.
| count | Number of bytes to extract; 0 extracts all available. |
| outBuffer | WriteOnly to fill with extracted bytes; resized as needed. |
Implements StormByte::Buffer::ReadOnly.
|
inlinevirtualnoexcept |
Expose the rest of overloads
Implements StormByte::Buffer::ReadOnly.
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
inlineoverridevirtualnoexcept |
Read all bytes until end-of-file into an existing buffer.
| outBuffer | Vector to fill with read bytes; resized as needed. |
Implements StormByte::Buffer::ReadOnly.
|
inlineoverridevirtualnoexcept |
Read all bytes until end-of-file into a WriteOnly buffer.
| outBuffer | WriteOnly to fill with read bytes; resized as needed. |
Implements StormByte::Buffer::ReadOnly.
|
staticprotectednoexcept |
Produce a hexdump of the given data span.
| data | Span of bytes to format. |
| start_offset | Starting offset for line addresses. |
| collumns | Number of bytes per line. |
Formats the provided byte span into a hexdump string with specified number of columns per line. Each line begins with the absolute offset (from start_offset), followed by hexadecimal byte values and ASCII representation.
|
virtualnoexcept |
Produce a hexdump of the unread contents starting at the current read position.
| collumns | Number of bytes per line (0 -> default 16). |
| byte_limit | Maximum number of bytes to include (0 -> no limit). |
Read Position: <offset> followed by the hex/ASCII lines. The returned string does not include a trailing newline.The hexdump is produced from a snapshot of the unread bytes and does not modify the FIFO's read position. Offsets printed on each line are absolute offsets (from the start of the underlying buffer). Formatting of the hex/ASCII lines is performed by FormatHexLines() to ensure consistent output between FIFO and SharedFIFO. Example output:
Reimplemented in StormByte::Buffer::SharedFIFO.
|
protectedvirtualnoexcept |
Produce a hexdump header with size and read position.
|
inlineoverridevirtualnoexcept |
Check if the buffer is readable.
Implements StormByte::Buffer::ReadOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
inlineoverridevirtualnoexcept |
Check if the buffer is writable.
Implements StormByte::Buffer::WriteOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
inlinenoexcept |
Inequality comparison.
Negates operator==.
|
inlinenoexcept |
Equality comparison.
Compares this FIFO with other by comparing their internal buffers. Equality is defined as having identical byte contents in the buffer and same read position.
|
inlineoverridevirtualnoexcept |
Non-destructive peek at buffer data without advancing read position.
| count | Number of bytes to peek; 0 peeks all available from read position. |
Similar to Read(), but does not advance the read position. Allows inspecting upcoming data without consuming it.
Semantics:
count == 0: the call returns all available bytes. If no bytes are available, a ReadError is returned.count > 0: the call returns exactly count bytes when that many bytes are available. If zero bytes are available, or if count is greater than the number of available bytes, a ReadError is returned.Implements StormByte::Buffer::ReadOnly.
|
inlineoverridevirtualnoexcept |
Non-destructive peek at buffer data without advancing read position.
| count | Number of bytes to peek; 0 peeks all available from read position. |
Similar to Read(), but does not advance the read position. Allows inspecting upcoming data without consuming it.
Semantics:
count == 0: the call returns all available bytes. If no bytes are available, a ReadError is returned.count > 0: the call returns exactly count bytes when that many bytes are available. If zero bytes are available, or if count is greater than the number of available bytes, a ReadError is returned.Implements StormByte::Buffer::ReadOnly.
|
inlineoverridevirtualnoexcept |
Non destructive read that removes data from the buffer into an existing vector.
| count | Number of bytes to extract; 0 extracts all available. |
| outBuffer | Vector to fill with extracted bytes; resized as needed. |
Implements StormByte::Buffer::ReadOnly.
|
virtualnoexcept |
Expose the rest of overloads
Implements StormByte::Buffer::ReadOnly.
|
inlineoverridevirtualnoexcept |
Destructive read that removes data from the buffer into a vector.
| count | Number of bytes to extract; 0 extracts all available. |
| outBuffer | WriteOnly to fill with extracted bytes; resized as needed. |
Implements StormByte::Buffer::ReadOnly.
|
virtualnoexcept |
Expose the rest of overloads
Implements StormByte::Buffer::ReadOnly.
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
protectedvirtualnoexcept |
Internal helper for read operations.
| count | Number of bytes to read. |
| outBuffer | Output buffer to store read bytes. |
| flag | Additional flag for read operation (1: copy, 2: move) |
Shared logic for read operations that first checks the internal buffer, then calls the external read function if needed.
|
protectedvirtualnoexcept |
Internal helper for read operations.
| count | Number of bytes to read. |
| outBuffer | Output buffer to store read bytes. |
| flag | Additional flag for read operation (1: copy, 2: move) |
Shared logic for read operations that first checks the internal buffer, then calls the external read function if needed.
|
inlineoverridevirtualnoexcept |
Read all bytes until end-of-file into an existing buffer.
| outBuffer | Vector to fill with read bytes; resized as needed. |
Implements StormByte::Buffer::ReadOnly.
|
inlineoverridevirtualnoexcept |
Read all bytes until end-of-file into a WriteOnly buffer.
| outBuffer | WriteOnly to fill with read bytes; resized as needed. |
Implements StormByte::Buffer::ReadOnly.
|
protectedvirtualnoexcept |
Internal helper for reading until end-of-file.
| outBuffer | Output buffer to store read bytes. |
| flag | Additional flag for read operation (1: copy, 2: move) |
|
protectedvirtualnoexcept |
Internal helper for reading until end-of-file.
| outBuffer | Output buffer to store read bytes. |
| flag | Additional flag for read operation (1: copy, 2: move) |
|
overridevirtualnoexcept |
Move the read position for non-destructive reads.
| position | The offset value to apply. |
| mode | Unused for base class; included for API consistency. |
Changes where subsequent Read() operations will start reading from. Position is clamped to [0, Size()]. Does not affect stored data.
Implements StormByte::Buffer::ReadOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
inlineoverridevirtualnoexcept |
Get the current number of bytes stored in the buffer.
Implements StormByte::Buffer::ReadOnly.
Reimplemented in StormByte::Buffer::SharedFIFO.
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
inlineoverridevirtualnoexcept |
Write bytes from a vector to the buffer.
| count | Number of bytes to write. |
| data | Byte vector to append to the WriteOnly. |
Appends data to the buffer, growing capacity automatically if needed. Handles wrap-around efficiently. Ignores writes if buffer is closed.
Implements StormByte::Buffer::WriteOnly.
|
virtualnoexcept |
Expose the rest of overloads
Implements StormByte::Buffer::WriteOnly.
|
inlineoverridevirtualnoexcept |
Write bytes from a vector to the buffer.
| count | Number of bytes to write. |
| data | Byte vector to append to the WriteOnly. |
Appends data to the buffer, growing capacity automatically if needed. Handles wrap-around efficiently. Ignores writes if buffer is closed.
Implements StormByte::Buffer::WriteOnly.
|
virtualnoexcept |
Expose the rest of overloads
Implements StormByte::Buffer::WriteOnly.
|
inlinenoexcept |
Expose the rest of overloads
|
inlineoverridevirtualnoexcept |
Move bytes from a vector to the buffer.
| count | Number of bytes to write. |
| data | Byte vector to append to the WriteOnly. |
Appends data to the buffer, growing capacity automatically if needed. Handles wrap-around efficiently. Ignores writes if buffer is closed.
Implements StormByte::Buffer::WriteOnly.
|
virtualnoexcept |
Expose the rest of overloads
Implements StormByte::Buffer::WriteOnly.
|
inlinenoexcept |
Expose the rest of overloads
|
inlineoverridevirtualnoexcept |
Move bytes from a vector to the buffer.
| count | Number of bytes to write. |
| data | Byte vector to append to the WriteOnly. |
Appends data to the buffer, growing capacity automatically if needed. Handles wrap-around efficiently. Ignores writes if buffer is closed.
Implements StormByte::Buffer::WriteOnly.
|
virtualnoexcept |
Expose the rest of overloads
Implements StormByte::Buffer::WriteOnly.
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
inlinenoexcept |
Expose the rest of overloads
|
protectedvirtualnoexcept |
Internal helper for write operations.
| dst | Destination buffer to write into. |
| count | Number of bytes to write. |
| src | Source buffer to write from. |
|
protectedvirtualnoexcept |
Internal helper for write operations.
| count | Number of bytes to write. |
| src | Source ReadOnly buffer to write from. |
|
protectedvirtualnoexcept |
Internal helper for write operations.
| dst | Destination buffer to write into. |
| count | Number of bytes to write. |
| src | Source buffer to write from. |
|
protectedvirtualnoexcept |
Internal helper for write operations.
| count | Number of bytes to write. |
| src | Source ReadOnly buffer to write from. |
|
mutableprotected |
Current read position for read operations.
Tracks the offset from the start of the buffer for all read operations.