| json.hpp(3) | Library Functions Manual | json.hpp(3) |
NAME
json.hpp - JSON input and output archives.
SYNOPSIS
#include 'cereal/cereal.hpp'
#include 'cereal/details/util.hpp'
#include 'cereal/external/rapidjson/prettywriter.h'
#include 'cereal/external/rapidjson/ostreamwrapper.h'
#include 'cereal/external/rapidjson/istreamwrapper.h'
#include 'cereal/external/rapidjson/document.h'
#include 'cereal/external/base64.hpp'
#include <limits>
#include <sstream>
#include <stack>
#include <vector>
#include <string>
Classes
struct cereal::RapidJSONException
An exception thrown when rapidjson fails an internal assertion. class
cereal::JSONOutputArchive
An output archive designed to save data to JSON. class
cereal::JSONOutputArchive::Options
A class containing various advanced options for the JSON archive. class
cereal::JSONInputArchive
An input archive designed to load data from JSON.
Macros
#define CEREAL_RAPIDJSON_ASSERT_THROWS
#define CEREAL_RAPIDJSON_ASSERT(x)
#define CEREAL_RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNanAndInfFlag
#define CEREAL_RAPIDJSON_PARSE_DEFAULT_FLAGS kParseFullPrecisionFlag |
kParseNanAndInfFlag
Functions
template<class T> void cereal::prologue
(JSONOutputArchive &, NameValuePair< T > const
&)
Prologue for NVPs for JSON archives. template<class T> void
cereal::prologue (JSONInputArchive &,
NameValuePair< T > const &)
Prologue for NVPs for JSON archives. template<class T> void
cereal::epilogue (JSONOutputArchive &,
NameValuePair< T > const &)
Epilogue for NVPs for JSON archives. template<class T> void
cereal::epilogue (JSONInputArchive &,
NameValuePair< T > const &)
Epilogue for NVPs for JSON archives. template<class T> void
cereal::prologue (JSONOutputArchive &,
DeferredData< T > const &)
Prologue for deferred data for JSON archives. template<class T> void
cereal::prologue (JSONInputArchive &,
DeferredData< T > const &)
Prologue for deferred data for JSON archives. template<class T> void
cereal::epilogue (JSONOutputArchive &,
DeferredData< T > const &)
Epilogue for deferred for JSON archives. template<class T> void
cereal::epilogue (JSONInputArchive &,
DeferredData< T > const &)
Epilogue for deferred for JSON archives. template<class T> void
cereal::prologue (JSONOutputArchive &ar,
SizeTag< T > const &)
Prologue for SizeTags for JSON archives. template<class T> void
cereal::prologue (JSONInputArchive &, SizeTag< T
> const &)
Prologue for SizeTags for JSON archives. template<class T> void
cereal::epilogue (JSONOutputArchive &, SizeTag<
T > const &)
Epilogue for SizeTags for JSON archives. template<class T> void
cereal::epilogue (JSONInputArchive &, SizeTag< T
> const &)
Epilogue for SizeTags for JSON archives. template<class T,
traits::EnableIf<!std::is_arithmetic< T >::value,
!traits::has_minimal_base_class_serialization< T,
traits::has_minimal_output_serialization, JSONOutputArchive
>::value, !traits::has_minimal_output_serialization< T,
JSONOutputArchive >::value > = traits::sfinae> void
cereal::prologue (JSONOutputArchive &ar, T const &)
Prologue for all other types for JSON archives (except minimal types).
template<class T, traits::EnableIf<!std::is_arithmetic< T
>::value, !traits::has_minimal_base_class_serialization< T,
traits::has_minimal_input_serialization, JSONInputArchive
>::value, !traits::has_minimal_input_serialization< T,
JSONInputArchive >::value > = traits::sfinae> void
cereal::prologue (JSONInputArchive &ar, T const &)
Prologue for all other types for JSON archives. template<class T,
traits::EnableIf<!std::is_arithmetic< T >::value,
!traits::has_minimal_base_class_serialization< T,
traits::has_minimal_output_serialization, JSONOutputArchive
>::value, !traits::has_minimal_output_serialization< T,
JSONOutputArchive >::value > = traits::sfinae> void
cereal::epilogue (JSONOutputArchive &ar, T const &)
Epilogue for all other types other for JSON archives (except minimal types).
template<class T, traits::EnableIf<!std::is_arithmetic< T
>::value, !traits::has_minimal_base_class_serialization< T,
traits::has_minimal_input_serialization, JSONInputArchive
>::value, !traits::has_minimal_input_serialization< T,
JSONInputArchive >::value > = traits::sfinae> void
cereal::epilogue (JSONInputArchive &ar, T const &)
Epilogue for all other types other for JSON archives. void
cereal::prologue (JSONOutputArchive &ar, std::nullptr_t
const &)
Prologue for arithmetic types for JSON archives. void cereal::prologue
(JSONInputArchive &, std::nullptr_t const &)
Prologue for arithmetic types for JSON archives. void cereal::epilogue
(JSONOutputArchive &, std::nullptr_t const &)
Epilogue for arithmetic types for JSON archives. void cereal::epilogue
(JSONInputArchive &, std::nullptr_t const &)
Epilogue for arithmetic types for JSON archives. template<class T,
traits::EnableIf< std::is_arithmetic< T >::value > =
traits::sfinae> void cereal::prologue (JSONOutputArchive
&ar, T const &)
Prologue for arithmetic types for JSON archives. template<class T,
traits::EnableIf< std::is_arithmetic< T >::value > =
traits::sfinae> void cereal::prologue (JSONInputArchive
&, T const &)
Prologue for arithmetic types for JSON archives. template<class T,
traits::EnableIf< std::is_arithmetic< T >::value > =
traits::sfinae> void cereal::epilogue (JSONOutputArchive
&, T const &)
Epilogue for arithmetic types for JSON archives. template<class T,
traits::EnableIf< std::is_arithmetic< T >::value > =
traits::sfinae> void cereal::epilogue (JSONInputArchive
&, T const &)
Epilogue for arithmetic types for JSON archives. template<class CharT,
class Traits, class Alloc> void cereal::prologue
(JSONOutputArchive &ar, std::basic_string< CharT, Traits,
Alloc > const &)
Prologue for strings for JSON archives. template<class CharT, class Traits,
class Alloc> void cereal::prologue (JSONInputArchive &,
std::basic_string< CharT, Traits, Alloc > const &)
Prologue for strings for JSON archives. template<class CharT, class Traits,
class Alloc> void cereal::epilogue (JSONOutputArchive
&, std::basic_string< CharT, Traits, Alloc > const &)
Epilogue for strings for JSON archives. template<class CharT, class Traits,
class Alloc> void cereal::epilogue (JSONInputArchive &,
std::basic_string< CharT, Traits, Alloc > const &)
Epilogue for strings for JSON archives. template<class T> void
cereal::CEREAL_SAVE_FUNCTION_NAME (JSONOutputArchive &ar,
NameValuePair< T > const &t)
Serializing NVP types to JSON. template<class T> void
cereal::CEREAL_LOAD_FUNCTION_NAME (JSONInputArchive &ar,
NameValuePair< T > &t)
void cereal::CEREAL_SAVE_FUNCTION_NAME (JSONOutputArchive
&ar, std::nullptr_t const &t)
Saving for nullptr to JSON. void cereal::CEREAL_LOAD_FUNCTION_NAME
(JSONInputArchive &ar, std::nullptr_t &t)
Loading arithmetic from JSON. template<class T, traits::EnableIf<
std::is_arithmetic< T >::value > = traits::sfinae> void
cereal::CEREAL_SAVE_FUNCTION_NAME (JSONOutputArchive &ar,
T const &t)
Saving for arithmetic to JSON. template<class T, traits::EnableIf<
std::is_arithmetic< T >::value > = traits::sfinae> void
cereal::CEREAL_LOAD_FUNCTION_NAME (JSONInputArchive &ar, T
&t)
Loading arithmetic from JSON. template<class CharT, class Traits, class
Alloc> void cereal::CEREAL_SAVE_FUNCTION_NAME
(JSONOutputArchive &ar, std::basic_string< CharT, Traits,
Alloc > const &str)
saving string to JSON template<class CharT, class Traits, class Alloc>
void cereal::CEREAL_LOAD_FUNCTION_NAME (JSONInputArchive
&ar, std::basic_string< CharT, Traits, Alloc > &str)
loading string from JSON template<class T> void
cereal::CEREAL_SAVE_FUNCTION_NAME (JSONOutputArchive &,
SizeTag< T > const &)
Saving SizeTags to JSON. template<class T> void
cereal::CEREAL_LOAD_FUNCTION_NAME (JSONInputArchive &ar,
SizeTag< T > &st)
Loading SizeTags from JSON.
Detailed Description
JSON input and output archives.
Macro Definition Documentation
#define CEREAL_RAPIDJSON_ASSERT( x)
Value:
if(!(x)){ \
throw ::cereal::RapidJSONException("rapidjson internal assertion failure: " #x); }
Function Documentation
template<class T> void cereal::epilogue (JSONInputArchive & , DeferredData< T > const & ) [inline]
Epilogue for deferred for JSON archives. Do nothing for the defer wrapper
template<class T> void cereal::epilogue (JSONInputArchive & , NameValuePair< T > const & ) [inline]
Epilogue for NVPs for JSON archives. NVPs do not start or finish nodes - they just set up the names
template<class T> void cereal::epilogue (JSONOutputArchive & , DeferredData< T > const & ) [inline]
Epilogue for deferred for JSON archives. NVPs do not start or finish nodes - they just set up the names
template<class T> void cereal::epilogue (JSONOutputArchive & , NameValuePair< T > const & ) [inline]
Epilogue for NVPs for JSON archives. NVPs do not start or finish nodes - they just set up the names
template<class T> void cereal::epilogue (JSONOutputArchive & , SizeTag< T > const & ) [inline]
Epilogue for SizeTags for JSON archives. SizeTags are strictly ignored for JSON
template<class T, traits::EnableIf<!std::is_arithmetic< T >::value, !traits::has_minimal_base_class_serialization< T, traits::has_minimal_output_serialization, JSONOutputArchive >::value, !traits::has_minimal_output_serialization< T, JSONOutputArchive >::value > = traits::sfinae> void cereal::epilogue (JSONOutputArchive & ar, T const & ) [inline]
Epilogue for all other types other for JSON archives (except minimal types). Finishes the node created in the prologue
Minimal types do not start or finish nodes
template<class T> void cereal::prologue (JSONOutputArchive & , DeferredData< T > const & ) [inline]
Prologue for deferred data for JSON archives. Do nothing for the defer wrapper
template<class T> void cereal::prologue (JSONOutputArchive & , NameValuePair< T > const & ) [inline]
Prologue for NVPs for JSON archives. NVPs do not start or finish nodes - they just set up the names
template<class T> void cereal::prologue (JSONOutputArchive & ar, SizeTag< T > const & ) [inline]
Prologue for SizeTags for JSON archives. SizeTags are strictly ignored for JSON, they just indicate that the current node should be made into an array
template<class T, traits::EnableIf<!std::is_arithmetic< T >::value, !traits::has_minimal_base_class_serialization< T, traits::has_minimal_output_serialization, JSONOutputArchive >::value, !traits::has_minimal_output_serialization< T, JSONOutputArchive >::value > = traits::sfinae> void cereal::prologue (JSONOutputArchive & ar, T const & ) [inline]
Prologue for all other types for JSON archives (except minimal types). Starts a new node, named either automatically or by some NVP, that may be given data by the type about to be archived
Minimal types do not start or finish nodes
Author
Generated automatically by Doxygen for cereal from the source code.
| Sat Oct 10 2026 08:08:15 | cereal |