BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
nlohmann::json_sax< BasicJsonType > Struct Template Referenceabstract

SAX interface. More...

#include <json.hpp>

Inheritance diagram for nlohmann::json_sax< BasicJsonType >:

Public Types

using number_integer_t = typename BasicJsonType::number_integer_t
using number_unsigned_t = typename BasicJsonType::number_unsigned_t
using number_float_t = typename BasicJsonType::number_float_t
using string_t = typename BasicJsonType::string_t
using binary_t = typename BasicJsonType::binary_t

Public Member Functions

virtual bool null ()=0
 a null value was read
virtual bool boolean (bool val)=0
 a boolean value was read
virtual bool number_integer (number_integer_t val)=0
 an integer number was read
virtual bool number_unsigned (number_unsigned_t val)=0
 an unsigned integer number was read
virtual bool number_float (number_float_t val, const string_t &s)=0
 a floating-point number was read
virtual bool string (string_t &val)=0
 a string value was read
virtual bool binary (binary_t &val)=0
 a binary value was read
virtual bool start_object (std::size_t elements)=0
 the beginning of an object was read
virtual bool key (string_t &val)=0
 an object key was read
virtual bool end_object ()=0
 the end of an object was read
virtual bool start_array (std::size_t elements)=0
 the beginning of an array was read
virtual bool end_array ()=0
 the end of an array was read
virtual bool parse_error (std::size_t position, const std::string &last_token, const detail::exception &ex)=0
 a parse error occurred
 json_sax ()=default
 json_sax (const json_sax &)=default
 json_sax (json_sax &&) noexcept=default
json_sax & operator= (const json_sax &)=default
json_sax & operator= (json_sax &&) noexcept=default
virtual ~json_sax ()=default

Detailed Description

template<typename BasicJsonType>
struct nlohmann::json_sax< BasicJsonType >

This class describes the SAX interface used by nlohmann::json::sax_parse. Each function is called in different situations while the input is parsed. The boolean return value informs the parser whether to continue processing the input.

Definition at line 5679 of file json.hpp.

Member Typedef Documentation

◆ binary_t

template<typename BasicJsonType>
using nlohmann::json_sax< BasicJsonType >::binary_t = typename BasicJsonType::binary_t

Definition at line 5685 of file json.hpp.

◆ number_float_t

template<typename BasicJsonType>
using nlohmann::json_sax< BasicJsonType >::number_float_t = typename BasicJsonType::number_float_t

Definition at line 5683 of file json.hpp.

◆ number_integer_t

template<typename BasicJsonType>
using nlohmann::json_sax< BasicJsonType >::number_integer_t = typename BasicJsonType::number_integer_t

Definition at line 5681 of file json.hpp.

◆ number_unsigned_t

template<typename BasicJsonType>
using nlohmann::json_sax< BasicJsonType >::number_unsigned_t = typename BasicJsonType::number_unsigned_t

Definition at line 5682 of file json.hpp.

◆ string_t

template<typename BasicJsonType>
using nlohmann::json_sax< BasicJsonType >::string_t = typename BasicJsonType::string_t

Definition at line 5684 of file json.hpp.

Constructor & Destructor Documentation

◆ json_sax() [1/3]

template<typename BasicJsonType>
nlohmann::json_sax< BasicJsonType >::json_sax ( )
default

◆ json_sax() [2/3]

template<typename BasicJsonType>
nlohmann::json_sax< BasicJsonType >::json_sax ( const json_sax< BasicJsonType > & )
default

◆ json_sax() [3/3]

template<typename BasicJsonType>
nlohmann::json_sax< BasicJsonType >::json_sax ( json_sax< BasicJsonType > && )
defaultnoexcept

◆ ~json_sax()

template<typename BasicJsonType>
virtual nlohmann::json_sax< BasicJsonType >::~json_sax ( )
virtualdefault

Member Function Documentation

◆ binary()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::binary ( binary_t & val)
pure virtual
Parameters
[in]valbinary value
Returns
whether parsing should proceed
Note
It is safe to move the passed binary value.

◆ boolean()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::boolean ( bool val)
pure virtual
Parameters
[in]valboolean value
Returns
whether parsing should proceed

◆ end_array()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::end_array ( )
pure virtual
Returns
whether parsing should proceed

◆ end_object()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::end_object ( )
pure virtual
Returns
whether parsing should proceed

◆ key()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::key ( string_t & val)
pure virtual
Parameters
[in]valobject key
Returns
whether parsing should proceed
Note
It is safe to move the passed string.

◆ null()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::null ( )
pure virtual
Returns
whether parsing should proceed

◆ number_float()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::number_float ( number_float_t val,
const string_t & s )
pure virtual
Parameters
[in]valfloating-point value
[in]sraw token value
Returns
whether parsing should proceed

◆ number_integer()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::number_integer ( number_integer_t val)
pure virtual
Parameters
[in]valinteger value
Returns
whether parsing should proceed

◆ number_unsigned()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::number_unsigned ( number_unsigned_t val)
pure virtual
Parameters
[in]valunsigned integer value
Returns
whether parsing should proceed

◆ operator=() [1/2]

template<typename BasicJsonType>
json_sax & nlohmann::json_sax< BasicJsonType >::operator= ( const json_sax< BasicJsonType > & )
default

◆ operator=() [2/2]

template<typename BasicJsonType>
json_sax & nlohmann::json_sax< BasicJsonType >::operator= ( json_sax< BasicJsonType > && )
defaultnoexcept

◆ parse_error()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::parse_error ( std::size_t position,
const std::string & last_token,
const detail::exception & ex )
pure virtual
Parameters
[in]positionthe position in the input where the error occurs
[in]last_tokenthe last read token
[in]exan exception object describing the error
Returns
whether parsing should proceed (must return false)

◆ start_array()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::start_array ( std::size_t elements)
pure virtual
Parameters
[in]elementsnumber of array elements or -1 if unknown
Returns
whether parsing should proceed
Note
binary formats may report the number of elements

◆ start_object()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::start_object ( std::size_t elements)
pure virtual
Parameters
[in]elementsnumber of object elements or -1 if unknown
Returns
whether parsing should proceed
Note
binary formats may report the number of elements

◆ string()

template<typename BasicJsonType>
virtual bool nlohmann::json_sax< BasicJsonType >::string ( string_t & val)
pure virtual
Parameters
[in]valstring value
Returns
whether parsing should proceed
Note
It is safe to move the passed string value.

The documentation for this struct was generated from the following file: