Cbeam
Loading...
Searching...
No Matches
cbeam::json::map_serializer< Map > Struct Template Reference

Provides JSON-style serialization logic for any map type Map. More...

#include <map.hpp>

Static Public Member Functions

static void serialize (const Map &map, container::buffer &stream)
 Serializes a map to a JSON-like representation, appending the result to a buffer.
 

Detailed Description

template<typename Map>
struct cbeam::json::map_serializer< Map >

Provides JSON-style serialization logic for any map type Map.

This serializer inserts comma separators between elements and wraps the serialized key-value pairs in braces {} when used via traits.

Template Parameters
MapA map-like type providing begin(), end(), and key_type, mapped_type.

Member Function Documentation

◆ serialize()

template<typename Map>
static void cbeam::json::map_serializer< Map >::serialize ( const Map & map,
container::buffer & stream )
inlinestatic

Serializes a map to a JSON-like representation, appending the result to a buffer.

Each key-value pair is serialized (via traits) and separated by commas.

Parameters
mapThe map to serialize.
streamA buffer to which the JSON-like output is appended.

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