47 public std::invalid_argument
55 const std::type_index& type_index()
const {
return _type_index; }
58 std::type_index _type_index;
63 public std::runtime_error
77 std::string_view type_name() const;
81 std::type_index type_index() const;
84 std::type_index _type_index;
85 std::
string _type_name;
159 using list = std::vector<formats>;
291 void serialize(const
std::type_info& type,
376 explicit
formats(
std::vector<
std::shared_ptr<const data>> bases);
379 data& writable_data();
382 std::shared_ptr<data> _data;
An adapter is both a deserializer and a serializer.
Provides extra information to routines used for deserialization and serialization.
Provides extra information to routines used for deserialization, collects the problems they encounter...
A deserializer holds the method for converting JSON source into an arbitrary C++ type.
Exception thrown if an insertion of a deserializer or serializer into a formats is attempted,...
Thrown when formats::deserialize does not have a deserializer for the provided type.
no_deserializer(const std::type_index &type)
Create a new exception.
no_deserializer(const std::type_info &type)
Create a new exception.
Thrown when formats::serialize does not have a serializer for the type it was asked to serialize.
no_serializer(const std::type_info &type, jsonv::path path=jsonv::path())
Create a new exception for the missing type, wanted at path.
no_serializer(const std::type_index &type, jsonv::path path=jsonv::path())
Create a new exception for the missing type, wanted at path.
Represents an exact path in some JSON structure.
A reader instance reads from some form of JSON source (probably a string) and converts it into a JSON...
Provides extra information to routines used for serialization: the formats to find other serializers ...
Exception thrown if there is any problem running serialize or to_json.
A serializer holds the method for converting an arbitrary C++ type into JSON, written token by token ...
Represents a single JSON value, which can be any one of a potential kind, each behaving slightly diff...
A writer instance writes a JSON ast_node sequence to some form of sink: an encoder,...
Copyright (c) 2014-2020 by Travis Gockel.
Copyright (c) 2012-2020 by Travis Gockel.
#define JSONV_NODISCARD
Warn if the caller discards the result of this function.
#define JSONV_PUBLIC
This function or class is part of the public API for JSON Voorhees.
duplicate_type_action
The action to take when an insertion of a deserializer or serializer into a formats is attempted,...
@ exception
A duplicate_type_error should be thrown.
@ ignore
The existing deserializer or serializer should be kept, but no exception should be thrown.
@ replace
The new deserializer or serializer should be inserted, and no exception should be thrown.
ast_node_type
Marker type for an encountered token type.
The exception a failed serialization throws.