JSON Voorhees
Killer JSON for C++
Loading...
Searching...
No Matches
serialize.hpp File Reference

Serialization of C++ types into a JSON token stream. More...

#include <jsonv/config.hpp>
#include <jsonv/forward.hpp>
#include <jsonv/path.hpp>
#include <jsonv/serialization/context.hpp>
#include <jsonv/serialization/serialization_error.hpp>
#include <jsonv/value.hpp>
#include <jsonv/version.hpp>
#include <jsonv/writer.hpp>
#include <concepts>
#include <iosfwd>
#include <optional>
#include <string>
#include <typeinfo>
+ Include dependency graph for serialize.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  jsonv::serialization_context
 Provides extra information to routines used for serialization: the formats to find other serializers in, and the version and user data the caller asked for. More...
 

Functions

template<typename T >
value jsonv::to_json (const T &from, const formats &fmts)
 Encode a JSON value from from using the provided fmts.
 
template<typename T >
value jsonv::to_json (const T &from)
 Encode a JSON value from from using jsonv::formats::global().
 
template<typename T >
std::string jsonv::serialize (const T &from, const formats &fmts=formats::global())
 Serialize from into JSON text using fmts (by default jsonv::formats::global()).
 
template<typename T >
std::string jsonv::serialize (const T &from, const serialization_context &context)
 Serialize from into JSON text through a context the caller built, exactly as the overload above does with one built from formats.
 
template<typename T >
void jsonv::serialize (const T &from, std::ostream &to, const formats &fmts=formats::global())
 Serialize from into to as JSON text using fmts (by default jsonv::formats::global()).
 
template<typename T >
void jsonv::serialize (const T &from, std::ostream &to, const serialization_context &context)
 Serialize from into to as JSON text through a context the caller built, exactly as the overload above does with one built from formats.
 
template<typename T >
void jsonv::serialize (const T &from, writer &to, const formats &fmts=formats::global())
 Serialize from into to using fmts (by default jsonv::formats::global()), as one value where the writer is: at the root, as the next element of an open array, or as the value of the key just written.
 
template<typename T >
void jsonv::serialize (const T &from, writer &to, const serialization_context &context)
 Serialize from into to through a context the caller built, as one value where the writer is, exactly as the overload above does with one built from formats.
 

Detailed Description

Serialization of C++ types into a JSON token stream.

Copyright (c) 2015-2026 by Travis Gockel. All rights reserved.

This program is free software: you can redistribute it and/or modify it under the terms of the Apache License as published by the Apache Software Foundation, either version 2 of the License, or (at your option) any later version.

Author
Travis Gockel (travi.nosp@m.s@go.nosp@m.ckelh.nosp@m.ut.c.nosp@m.om)

Definition in file serialize.hpp.