14#ifndef __JSONV_COERCE_HPP_INCLUDED__
15#define __JSONV_COERCE_HPP_INCLUDED__
An adapter for enumeration types.
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_PUBLIC
This function or class is part of the public API for JSON Voorhees.
JSONV_PUBLIC std::int64_t coerce_integer(const value &from)
Coerce from into an integer.
JSONV_PUBLIC std::string coerce_string(const value &from)
Coerce from into an std::string.
JSONV_PUBLIC bool coerce_boolean(const value &from)
Coerce from into a bool.
JSONV_PUBLIC std::nullptr_t coerce_null(const value &from)
Coerce from into a null.
JSONV_PUBLIC value coerce_merge(value a, value b)
Combines a and b in any way possible.
JSONV_PUBLIC std::vector< value > coerce_array(const value &from)
Coerce from into a vector.
JSONV_PUBLIC std::map< std::string, value > coerce_object(const value &from)
Coerce from into a map.
JSONV_PUBLIC double coerce_decimal(const value &from)
Coerce from into a double.
JSONV_PUBLIC bool can_coerce(const kind &from, const kind &to)
Can the given kind be converted from a kind to another?
kind
Describes the kind of data a value holds.
Copyright (c) 2012-2020 by Travis Gockel.