deserialization of CBOR, MessagePack, and UBJSON values
More...
#include <acts/blob/sPHENIX/thirdparty/nlohmann_json/single_include/nlohmann/json.hpp>
|
bool | parse_bson_internal () |
| Reads in a BSON-object and passes it to the SAX-parser.
|
|
bool | get_bson_cstr (string_t &result) |
| Parses a C-style string from the BSON input.
|
|
template<typename NumberType > |
bool | get_bson_string (const NumberType len, string_t &result) |
| Parses a zero-terminated string of length len from the BSON input.
|
|
bool | parse_bson_element_internal (const int element_type, const std::size_t element_type_parse_position) |
| Read a BSON document element of the given element_type.
|
|
bool | parse_bson_element_list (const bool is_array) |
| Read a BSON element list (as specified in the BSON-spec)
|
|
bool | parse_bson_array () |
| Reads an array from the BSON input and passes it to the SAX-parser.
|
|
bool | parse_cbor_internal (const bool get_char=true) |
|
bool | get_cbor_string (string_t &result) |
| reads a CBOR string
|
|
bool | get_cbor_array (const std::size_t len) |
|
bool | get_cbor_object (const std::size_t len) |
|
bool | parse_msgpack_internal () |
|
bool | get_msgpack_string (string_t &result) |
| reads a MessagePack string
|
|
bool | get_msgpack_array (const std::size_t len) |
|
bool | get_msgpack_object (const std::size_t len) |
|
bool | parse_ubjson_internal (const bool get_char=true) |
|
bool | get_ubjson_string (string_t &result, const bool get_char=true) |
| reads a UBJSON string
|
|
bool | get_ubjson_size_value (std::size_t &result) |
|
bool | get_ubjson_size_type (std::pair< std::size_t, int > &result) |
| determine the type and size for a container
|
|
bool | get_ubjson_value (const int prefix) |
|
bool | get_ubjson_array () |
|
bool | get_ubjson_object () |
|
int | get () |
| get next character from the input
|
|
int | get_ignore_noop () |
|
template<typename NumberType , bool InputIsLittleEndian = false> |
bool | get_number (const input_format_t format, NumberType &result) |
|
template<typename NumberType > |
bool | get_string (const input_format_t format, const NumberType len, string_t &result) |
| create a string by reading characters from the input
|
|
bool | unexpect_eof (const input_format_t format, const char *context) const |
|
std::string | get_token_string () const |
|
std::string | exception_message (const input_format_t format, const std::string &detail, const std::string &context) const |
|
template<typename BasicJsonType, typename SAX = json_sax_dom_parser<BasicJsonType>>
class nlohmann::detail::binary_reader< BasicJsonType, SAX >
deserialization of CBOR, MessagePack, and UBJSON values
Definition at line 5504 of file json.hpp.
View newest version in sPHENIX GitHub at line 5504 of file json.hpp
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
- Parameters
-
[in] | format | the current format |
[in] | detail | a detailed error message |
[in] | context | further context information |
- Returns
- a message string to use in the parse_error exceptions
Definition at line 7404 of file json.hpp.
View newest version in sPHENIX GitHub at line 7404 of file json.hpp
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
get next character from the input
This function provides the interface to the used input adapter. It does not throw in case the input reached EOF, but returns a -'ve valued std::char_traits<char>::eof()
in that case.
- Returns
- character read from the input
Definition at line 7278 of file json.hpp.
View newest version in sPHENIX GitHub at line 7278 of file json.hpp
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
Parses a C-style string from the BSON input.
- Parameters
-
[in,out] | result | A reference to the string variable where the read string is to be stored. |
- Returns
true
if the -byte indicating the end of the string was encountered before the EOF; false` indicates an unexpected EOF.
Definition at line 5636 of file json.hpp.
View newest version in sPHENIX GitHub at line 5636 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename NumberType >
Parses a zero-terminated string of length len from the BSON input.
- Parameters
-
[in] | len | The length (including the zero-byte at the end) of the string to be read. |
[in,out] | result | A reference to the string variable where the read string is to be stored. |
- Template Parameters
-
NumberType | The type of the length len |
- Precondition
- len >= 1
- Returns
true
if the string was successfully parsed
Definition at line 5668 of file json.hpp.
View newest version in sPHENIX GitHub at line 5668 of file json.hpp
References JSON_HEDLEY_UNLIKELY, and nlohmann::to_string().
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
- Parameters
-
[in] | len | the length of the array or std::size_t(-1) for an array of indefinite size |
- Returns
- whether array creation completed
Definition at line 6257 of file json.hpp.
View newest version in sPHENIX GitHub at line 6257 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
- Parameters
-
[in] | len | the length of the object or std::size_t(-1) for an object of indefinite size |
- Returns
- whether object creation completed
Definition at line 6293 of file json.hpp.
View newest version in sPHENIX GitHub at line 6293 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
reads a CBOR string
This function first reads starting bytes to determine the expected string length and then copies this number of bytes into a string. Additionally, CBOR's strings with indefinite lengths are supported.
- Parameters
-
[out] | result | created string |
- Returns
- whether string creation completed
Definition at line 6168 of file json.hpp.
View newest version in sPHENIX GitHub at line 6168 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
- Returns
- character read from the input after ignoring all 'N' entries
Definition at line 7287 of file json.hpp.
View newest version in sPHENIX GitHub at line 7287 of file json.hpp
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
- Parameters
-
[in] | len | the length of the array |
- Returns
- whether array creation completed
Definition at line 6785 of file json.hpp.
View newest version in sPHENIX GitHub at line 6785 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
- Parameters
-
[in] | len | the length of the object |
- Returns
- whether object creation completed
Definition at line 6807 of file json.hpp.
View newest version in sPHENIX GitHub at line 6807 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
reads a MessagePack string
This function first reads starting bytes to determine the expected string length and then copies this number of bytes into a string.
- Parameters
-
[out] | result | created string |
- Returns
- whether string creation completed
Definition at line 6709 of file json.hpp.
View newest version in sPHENIX GitHub at line 6709 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename NumberType , bool InputIsLittleEndian = false>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename NumberType >
create a string by reading characters from the input
- Template Parameters
-
NumberType | the type of the number |
- Parameters
-
[in] | format | the current format (for diagnostics) |
[in] | len | number of characters to read |
[out] | result | string created by reading len bytes |
- Returns
- whether string creation completed
- Note
- We can not reserve len bytes for the result, because len may be too large. Usually, unexpect_eof() detects the end of the input before we run out of string memory.
Definition at line 7355 of file json.hpp.
View newest version in sPHENIX GitHub at line 7355 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
- Returns
- a string representation of the last read byte
Definition at line 7391 of file json.hpp.
View newest version in sPHENIX GitHub at line 7391 of file json.hpp
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
determine the type and size for a container
In the optimized UBJSON format, a type and a size can be provided to allow for a more compact representation.
- Parameters
-
[out] | result | pair of the size and the type |
- Returns
- whether pair creation completed
Definition at line 6994 of file json.hpp.
View newest version in sPHENIX GitHub at line 6994 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
- Parameters
-
[out] | result | determined size |
- Returns
- whether size determination completed
Definition at line 6917 of file json.hpp.
View newest version in sPHENIX GitHub at line 6917 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
reads a UBJSON string
This function is either called after reading the 'S' byte explicitly indicating a string, or in case of an object key where the 'S' byte can be left out.
- Parameters
-
[out] | result | created string |
[in] | get_char | whether a new character should be retrieved from the input (true, default) or whether the last read character should be considered instead |
- Returns
- whether string creation completed
Definition at line 6863 of file json.hpp.
View newest version in sPHENIX GitHub at line 6863 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
Reads an array from the BSON input and passes it to the SAX-parser.
- Returns
- whether a valid BSON-array was passed to the SAX parser
Definition at line 5797 of file json.hpp.
View newest version in sPHENIX GitHub at line 5797 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
bool nlohmann::detail::binary_reader< BasicJsonType, SAX >::parse_bson_element_internal |
( |
const int |
element_type, |
|
|
const std::size_t |
element_type_parse_position |
|
) |
| |
|
inlineprivate |
Read a BSON document element of the given element_type.
- Parameters
-
[in] | element_type | The BSON element type, c.f. http://bsonspec.org/spec.html |
[in] | element_type_parse_position | The position in the input stream, where the element_type was read. |
- Warning
- Not all BSON element types are supported yet. An unsupported element_type will give rise to a parse_error.114: Unsupported BSON record type 0x...
- Returns
- whether a valid BSON-object/array was passed to the SAX parser
Definition at line 5689 of file json.hpp.
View newest version in sPHENIX GitHub at line 5689 of file json.hpp
References value.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
Read a BSON element list (as specified in the BSON-spec)
The same binary layout is used for objects and arrays, hence it must be indicated with the argument is_array which one is expected (true –> array, false –> object).
- Parameters
-
[in] | is_array | Determines if the element list being read is to be treated as an object (is_array == false), or as an array (is_array == true). |
- Returns
- whether a valid BSON-object/array was passed to the SAX parser
Definition at line 5760 of file json.hpp.
View newest version in sPHENIX GitHub at line 5760 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
Reads in a BSON-object and passes it to the SAX-parser.
- Returns
- whether a valid BSON-value was passed to the SAX parser
Definition at line 5611 of file json.hpp.
View newest version in sPHENIX GitHub at line 5611 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
- Parameters
-
[in] | get_char | whether a new character should be retrieved from the input (true, default) or whether the last read character should be considered instead |
- Returns
- whether a valid UBJSON value was passed to the SAX parser
Definition at line 6844 of file json.hpp.
View newest version in sPHENIX GitHub at line 6844 of file json.hpp
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
- Parameters
-
[in] | format | the current format (for diagnostics) |
[in] | context | further context information (for diagnostics) |
- Returns
- whether the last read character is not EOF
Definition at line 7378 of file json.hpp.
View newest version in sPHENIX GitHub at line 7378 of file json.hpp
References JSON_HEDLEY_UNLIKELY.
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
the number of characters read
Definition at line 7443 of file json.hpp.
View newest version in sPHENIX GitHub at line 7443 of file json.hpp
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
the current character
Definition at line 7440 of file json.hpp.
View newest version in sPHENIX GitHub at line 7440 of file json.hpp
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
input adapter
Definition at line 7437 of file json.hpp.
View newest version in sPHENIX GitHub at line 7437 of file json.hpp
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
whether we can assume little endianess
Definition at line 7446 of file json.hpp.
View newest version in sPHENIX GitHub at line 7446 of file json.hpp
template<typename BasicJsonType , typename SAX = json_sax_dom_parser<BasicJsonType>>
the SAX parser
Definition at line 7449 of file json.hpp.
View newest version in sPHENIX GitHub at line 7449 of file json.hpp
The documentation for this class was generated from the following file:
- acts/blob/sPHENIX/thirdparty/nlohmann_json/single_include/nlohmann/json.hpp