40 virtual const std::type_info&
get_type() const noexcept
override
47 virtual std::expected<void, ast_node_type>
54 new(into) T(std::move(created).value());
61 context.note_value_consumed(from);
68 return std::unexpected(created.error());
111 virtual std::expected<T, ast_node_type>
117 detail::borrowed_subtree subtree(
context, from);
Copyright (c) 2015-2020 by Travis Gockel.
An adapter for the type T.
virtual const std::type_info & get_type() const noexcept override
virtual value to_json(const serialization_context &context, const void *from) const override
virtual std::expected< T, ast_node_type > create(extraction_context &context, reader &from) const =0
Create an instance of T by reading from.
virtual std::expected< void, ast_node_type > extract(extraction_context &context, reader &from, void *into) const override
An adapter is both an extractor and a serializer.
Provides extra information to routines used for extraction and serialization.
A reader instance reads from some form of JSON source (probably a string) and converts it into a JSON...
A base for adapters written against the older value -based extraction interface.
virtual std::expected< T, ast_node_type > create(extraction_context &context, reader &from) const final override
Create an instance of T by reading from.
virtual T create(extraction_context &context, const value &from) const =0
Create an instance of T from the materialised from.
Represents a single JSON value, which can be any one of a potential kind, each behaving slightly diff...
Copyright (c) 2014-2020 by Travis Gockel.
#define JSONV_NODISCARD
Warn if the caller discards the result of this function.
Copyright (c) 2012-2020 by Travis Gockel.