Cbeam
Loading...
Searching...
No Matches
cbeam::json::traits< std::string > Struct Reference

Specialization of traits for std::string providing JSON serialization. More...

#include <string.hpp>

Static Public Member Functions

static void serialize (const std::string &str, container::buffer &stream)
 
static void serialize (const std::string &val, container::buffer &stream)
 Required to serialize an object of type T into a shared_buffer stream.
 

Detailed Description

Specialization of traits for std::string providing JSON serialization.

Strings are enclosed in quotes and special characters are escaped using cbeam::convert::escape_string.

Member Function Documentation

◆ serialize() [1/2]

static void cbeam::json::traits< std::string >::serialize ( const std::string & str,
container::buffer & stream )
inlinestatic

◆ serialize() [2/2]

static void cbeam::json::traits< std::string >::serialize ( const std::string & val,
container::buffer & stream )
inlinestatic

Required to serialize an object of type T into a shared_buffer stream.

Parameters
valueThe object to serialize.
streamThe shared_buffer stream into which the object is serialized.

This method should take an object of type T and serialize it into a container::buffer stream. by using its append method.


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