detail namespace with internal helper functions Más...
Espacios de nombres | |
| namespace | dtoa_impl |
| implements the Grisu2 algorithm for binary to decimal floating-point conversion. | |
Clases | |
| struct | position_t |
| struct to capture the start position of the current token Más... | |
| class | exception |
| general exception of the basic_json class Más... | |
| class | parse_error |
| exception indicating a parse error Más... | |
| class | invalid_iterator |
| exception indicating errors with iterators Más... | |
| class | type_error |
| exception indicating executing a member function with a wrong type Más... | |
| class | out_of_range |
| exception indicating access out of the defined range Más... | |
| class | other_error |
| exception indicating other library errors Más... | |
| class | iteration_proxy |
| proxy class for the items() function Más... | |
| class | file_input_adapter |
| class | input_stream_adapter |
| class | lexer |
| lexical analysis Más... | |
| class | json_sax_dom_parser |
| SAX implementation to create a JSON value from SAX events. Más... | |
| class | binary_reader |
| deserialization of CBOR, MessagePack, and UBJSON values Más... | |
| class | parser |
| syntax analysis Más... | |
| struct | internal_iterator |
| an iterator value Más... | |
| struct | json_default_base |
| Default base class of the basic_json class. Más... | |
| class | binary_writer |
| serialization to CBOR and MessagePack values Más... | |
Enumeraciones | |
| enum class | value_t : std::uint8_t { null , object , array , string , boolean , number_integer , number_unsigned , number_float , binary , discarded } |
| the JSON type enumeration Más... | |
| enum class | input_format_t |
| the supported input formats | |
| enum class | cbor_tag_handler_t { error , ignore , store } |
| how to treat CBOR tags Más... | |
| enum class | error_handler_t { strict , replace , ignore } |
Funciones | |
| bool | operator< (const value_t lhs, const value_t rhs) noexcept |
| comparison operator for JSON types | |
| template<typename StringType> | |
| void | replace_substring (StringType &s, const StringType &f, const StringType &t) |
| replace all occurrences of a substring by another string | |
| template<typename StringType> | |
| StringType | escape (StringType s) |
| string escaping as described in RFC 6901 (Sect. 4) | |
| template<typename BasicJsonType> | |
| std::size_t | hash (const BasicJsonType &j) |
| hash a JSON value | |
| template<typename FloatType> | |
| JSON_HEDLEY_RETURNS_NON_NULL char * | to_chars (char *first, const char *last, FloatType value) |
| generates a decimal representation of the floating-point number value in [first, last). | |
detail namespace with internal helper functions
This namespace collects functions that should not be exposed, implementations of some basic_json methods, and meta-programming helpers.
|
strong |
how to treat CBOR tags
| Valores de enumeraciones | |
|---|---|
| error | throw a parse_error exception in case of a tag |
| ignore | ignore tags |
| store | store tags as binary type |
|
strong |
| Valores de enumeraciones | |
|---|---|
| strict | throw a type_error exception in case of invalid UTF-8 |
| replace | replace invalid UTF-8 sequences with U+FFFD |
| ignore | ignore invalid UTF-8 sequences |
|
strong |
the JSON type enumeration
This enumeration collects the different JSON types. It is internally used to distinguish the stored values, and the functions basic_json::is_null(), basic_json::is_object(), basic_json::is_array(), basic_json::is_string(), basic_json::is_boolean(), basic_json::is_number() (with basic_json::is_number_integer(), basic_json::is_number_unsigned(), and basic_json::is_number_float()), basic_json::is_discarded(), basic_json::is_primitive(), and basic_json::is_structured() rely on it.
|
inline |
string escaping as described in RFC 6901 (Sect. 4)
| [in] | s | string to escape |
Note the order of escaping "~" to "~0" and "/" to "~1" is important.
| std::size_t detail::hash | ( | const BasicJsonType & | j | ) |
hash a JSON value
The hash function tries to rely on std::hash where possible. Furthermore, the type of the JSON value is taken into account to have different hash values for null, 0, 0U, and false, etc.
| BasicJsonType | basic_json specialization |
| j | JSON value to hash |
comparison operator for JSON types
Returns an ordering that is similar to Python:
|
inline |
replace all occurrences of a substring by another string
| [in,out] | s | the string to manipulate; changed so that all occurrences of f are replaced with t |
| [in] | f | the substring to replace with t |
| [in] | t | the string to replace f |
| JSON_HEDLEY_RETURNS_NON_NULL char * detail::to_chars | ( | char * | first, |
| const char * | last, | ||
| FloatType | value ) |
generates a decimal representation of the floating-point number value in [first, last).
The format of the resulting decimal representation is similar to printf's g format. Returns an iterator pointing past-the-end of the decimal representation.