StormByte 2.0.0
C++26 foundation of the StormByte suite
 
Loading...
Searching...
No Matches
StormByte::Detail::Codec< WCString > Struct Reference

StormByte::Detail::Codec specialization for StormByte::WCString. More...

#include <StormByte/serializable.hxx>

Static Public Member Functions

static std::size_t Size (const WCString &data) noexcept
 Serialized size of data.
 
static std::vector< std::byte > Write (const WCString &data) noexcept
 Encodes data.
 
static Expected< WCString, DeserializeError > Read (std::span< const std::byte > data) noexcept
 Decodes a StormByte::WCString from the start of data.
 

Detailed Description

StormByte::Detail::Codec specialization for StormByte::WCString.

Same UTF-8 wire as std::wstring. A null StormByte::WCString is written as an empty payload. Decode always yields a non-null buffer (L"" when the payload is empty).

Member Function Documentation

◆ Read()

static Expected< WCString, DeserializeError > StormByte::Detail::Codec< WCString >::Read ( std::span< const std::byte >  data)
staticnoexcept

Decodes a StormByte::WCString from the start of data.

Parameters
dataInput span.
Returns
Value, or StormByte::DeserializeError.

◆ Size()

static std::size_t StormByte::Detail::Codec< WCString >::Size ( const WCString &  data)
staticnoexcept

Serialized size of data.

Parameters
dataValue to measure.
Returns
Size in bytes.

◆ Write()

static std::vector< std::byte > StormByte::Detail::Codec< WCString >::Write ( const WCString &  data)
staticnoexcept

Encodes data.

Parameters
dataValue to encode.
Returns
Blob.

The documentation for this struct was generated from the following file: