StormByte::Detail::Codec specialization for StormByte::Safe::String. More...
#include <StormByte/serializable.hxx>
Static Public Member Functions | |
| static ByteSize | Size (const Safe::String &data) noexcept |
Serialized size of data. | |
| static Safe::Binary | Write (const Safe::String &data) noexcept |
Encodes data. | |
| static Expected< Safe::String, DeserializeError > | Read (std::span< const std::byte > data) noexcept |
Decodes a StormByte::Safe::String from the start of data. | |
StormByte::Detail::Codec specialization for StormByte::Safe::String.
Same wire as std::string: uint64 byte count (LE) + raw bytes. Embedded NUL bytes are preserved. A null StormByte::Safe::String is written as an empty payload (operator std::string). Decode always yields a non-null buffer ("" when the payload is empty).
|
staticnoexcept |
Decodes a StormByte::Safe::String from the start of data.
| data | Input span. |
|
staticnoexcept |
|
staticnoexcept |
Encodes data.
| data | Value to encode. |