StormByte::Detail::Codec specialization for StormByte::Safe::CString. More...
#include <StormByte/serializable.hxx>
Static Public Member Functions | |
| static ByteSize | Size (const Safe::CString &data) noexcept |
Serialized size of data. | |
| static BinaryData | Write (const Safe::CString &data) noexcept |
Encodes data. | |
| static Expected< Safe::CString, DeserializeError > | Read (std::span< const std::byte > data) noexcept |
Decodes a StormByte::Safe::CString from the start of data. | |
StormByte::Detail::Codec specialization for StormByte::Safe::CString.
Same wire as std::string: uint64 byte count (LE) + raw bytes. A null StormByte::Safe::CString 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::CString from the start of data.
| data | Input span. |
|
staticnoexcept |
|
staticnoexcept |
Encodes data.
| data | Value to encode. |