|
StormByte C++ Library: Buffer module 1.2.0
StormByte-Buffer is the buffer module of the StormByte C++ suite.
|
Abstract interface for writing data to an external or internal sink. More...
#include <StormByte/buffer/external.hxx>


Public Member Functions | |
Constructors / destructor / assignment | |
| ExternalWriter () noexcept=default | |
| ExternalWriter (const ExternalWriter &)=default | |
| ExternalWriter (ExternalWriter &&) noexcept=default | |
| ~ExternalWriter () noexcept override | |
| ExternalWriter & | operator= (const ExternalWriter &)=default |
| ExternalWriter & | operator= (ExternalWriter &&) noexcept=default |
Queries | |
| virtual bool | IsWritable () const noexcept=0 |
| Whether the sink still accepts writes. | |
Writing (canonical overloads) | |
| virtual bool | Write (const DataType &data) noexcept=0 |
| Write (copy) a full byte vector. | |
| virtual bool | Write (DataType &&data) noexcept=0 |
| Write (move) a full byte vector. | |
| virtual bool | Write (std::size_t count, const DataType &data) noexcept=0 |
Write up to count bytes from a vector (copy). | |
| virtual bool | Write (std::size_t count, DataType &&data) noexcept=0 |
Write up to count bytes from a vector (move). | |
Writing (string conveniences) | |
Non-virtual helpers implemented in terms of the canonical overloads. These ensure | |
| bool | Write (std::string_view sv) noexcept |
| Write a string view (no terminating NUL). | |
| bool | Write (const char *s) noexcept |
| Write a null-terminated C string. | |
| bool | Write (std::size_t count, std::string_view sv) noexcept |
Write up to count characters from a string view. | |
| template<std::size_t N> | |
| bool | Write (const char(&s)[N]) noexcept |
| Write a string literal without the trailing NUL. | |
End-of-stream signalling | |
| virtual void | Close () noexcept=0 |
| Mark the sink closed for further writes. | |
| virtual void | SetError () noexcept=0 |
| Put the sink into a permanent error state. | |
Abstract interface for writing data to an external or internal sink.
|
defaultnoexcept |
|
default |
|
defaultnoexcept |
|
overridenoexcept |
|
pure virtualnoexcept |
Mark the sink closed for further writes.
Subsequent Write() calls must fail. Readers can still drain remaining data. Implementations should wake any waiting readers.
Implemented in StormByte::Buffer::ExternalBufferWriter.
|
pure virtualnoexcept |
Whether the sink still accepts writes.
false when the sink has been closed or is in error state. Implemented in StormByte::Buffer::ExternalBufferWriter.
|
default |
|
defaultnoexcept |
|
pure virtualnoexcept |
Put the sink into a permanent error state.
Makes the sink unreadable and unwritable from the buffer’s perspective. Implementations should wake any waiters.
Implemented in StormByte::Buffer::ExternalBufferWriter.
|
noexcept |
Write a null-terminated C string.
| s | Source string (may be null → empty write). |
true on success, false if the sink is closed / in error.
|
inlinenoexcept |
Write a string literal without the trailing NUL.
| N | Array extent (includes the NUL for literals). |
| s | String literal / char array. |
true on success, false if the sink is closed / in error.
|
pure virtualnoexcept |
Write (copy) a full byte vector.
| data | Data to append. |
true on success, false if the sink is closed / in error. Implemented in StormByte::Buffer::ExternalBufferWriter.
|
pure virtualnoexcept |
Write (move) a full byte vector.
| data | Data to append (emptied on success when the implementation moves). |
true on success, false if the sink is closed / in error. Implemented in StormByte::Buffer::ExternalBufferWriter.
|
pure virtualnoexcept |
Write up to count bytes from a vector (copy).
| count | Maximum bytes to write (0 = entire vector). |
| data | Source vector. |
true on success, false if the sink is closed / in error. Implemented in StormByte::Buffer::ExternalBufferWriter.
|
pure virtualnoexcept |
Write up to count bytes from a vector (move).
| count | Maximum bytes to write (0 = entire vector). |
| data | Source vector (may be modified on success). |
true on success, false if the sink is closed / in error. Implemented in StormByte::Buffer::ExternalBufferWriter.
|
noexcept |
Write up to count characters from a string view.
| count | Maximum characters (0 = entire view). |
| sv | Source characters. |
true on success, false if the sink is closed / in error.
|
noexcept |
Write a string view (no terminating NUL).
| sv | Source characters. |
true on success, false if the sink is closed / in error.