BitStream
bitstream::serialize_traits< const char * > Struct Reference

A trait used to serialize bounded c-style strings. More...

#include <string_traits.h>

Static Public Member Functions

template<typename Stream >
static utility::is_writing_t< Stream > serialize (Stream &writer, const char *value, uint32_t max_size) noexcept
 Writes a c-style string into the writer. More...
 
template<typename Stream >
static utility::is_reading_t< Stream > serialize (Stream &reader, char *value, uint32_t max_size) noexcept
 Read a c-style string from the reader into value. More...
 

Detailed Description

A trait used to serialize bounded c-style strings.

Member Function Documentation

◆ serialize() [1/2]

template<typename Stream >
static utility::is_reading_t<Stream> bitstream::serialize_traits< const char * >::serialize ( Stream &  reader,
char *  value,
uint32_t  max_size 
)
inlinestaticnoexcept

Read a c-style string from the reader into value.

Parameters
readerThe stream to read from
valueA pointer to the buffer that should be read into. The size of this buffer should be at least max_size
max_sizeThe maximum expected length of the string, including the null terminator
Returns
Success

◆ serialize() [2/2]

template<typename Stream >
static utility::is_writing_t<Stream> bitstream::serialize_traits< const char * >::serialize ( Stream &  writer,
const char *  value,
uint32_t  max_size 
)
inlinestaticnoexcept

Writes a c-style string into the writer.

Parameters
writerThe stream to write to
valueThe string to serialize
max_sizeThe maximum expected length of the string, including the null terminator
Returns
Success

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