JSON Voorhees
Killer JSON for C++
serialization.hpp File Reference

Conversion between C++ types and JSON values. More...

#include <jsonv/config.hpp>
#include <jsonv/detail/nested_exception.hpp>
#include <jsonv/detail/scope_exit.hpp>
#include <jsonv/path.hpp>
#include <jsonv/value.hpp>
#include <memory>
#include <new>
#include <typeinfo>
#include <typeindex>
#include <type_traits>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  jsonv::version
 Represents a version used to extract and encode JSON objects from C++ classes. More...
 
class  jsonv::duplicate_type_error
 Exception thrown if an insertion of an extractor or serializer into a formats is attempted, but there is already an extractor or serializer for that type. More...
 
class  jsonv::extraction_error
 Exception thrown if there is any problem running extract. More...
 
class  jsonv::no_extractor
 Thrown when formats::extract does not have an extractor for the provided type. More...
 
class  jsonv::no_serializer
 Thrown when formats::to_json does not have a serializer for the provided type. More...
 
class  jsonv::extractor
 An extractor holds the method for converting a value into an arbitrary C++ type. More...
 
class  jsonv::serializer
 A serializer holds the method for converting an arbitrary C++ type into a value. More...
 
class  jsonv::adapter
 An adapter is both an extractor and a serializer. More...
 
class  jsonv::formats
 Simply put, this class is a collection of extractor and serializer instances. More...
 
class  jsonv::context_base
 Provides extra information to routines used for extraction. More...
 
class  jsonv::extraction_context
 
class  jsonv::serialization_context
 

Enumerations

enum  jsonv::duplicate_type_action : unsigned char { jsonv::duplicate_type_action::ignore, jsonv::duplicate_type_action::replace, jsonv::duplicate_type_action::exception }
 The action to take when an insertion of an extractor or serializer into a formats is attempted, but there is alredy an extractor or serializer for that type. More...
 

Functions

template<typename T >
jsonv::extract (const value &from, const formats &fmts)
 Extract a C++ value from from using the provided fmts. More...
 
template<typename T >
jsonv::extract (const value &from)
 Extract a C++ value from from using jsonv::formats::global(). More...
 
template<typename T >
value jsonv::to_json (const T &from, const formats &fmts)
 Encode a JSON value from from using the provided fmts. More...
 
template<typename T >
value jsonv::to_json (const T &from)
 Encode a JSON value from from using jsonv::formats::global(). More...
 

Detailed Description

Conversion between C++ types and JSON values.

Copyright (c) 2015 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 serialization.hpp.