STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
detail::parse_error Class Reference

exception indicating a parse error More...

#include <json.hpp>

Inheritance diagram for detail::parse_error:
[legend]
Collaboration diagram for detail::parse_error:
[legend]

Static Public Member Functions

template<typename BasicJsonContext, enable_if_t< is_basic_json_context< BasicJsonContext >::value, int > = 0>
static parse_error create (int id_, const position_t &pos, const std::string &what_arg, BasicJsonContext context)
 create a parse error exception
template<typename BasicJsonContext, enable_if_t< is_basic_json_context< BasicJsonContext >::value, int > = 0>
static parse_error create (int id_, std::size_t byte_, const std::string &what_arg, BasicJsonContext context)

Public Attributes

const std::size_t byte
 byte index of the parse error
Public Attributes inherited from detail::exception
const int id
 the id of the exception

Private Member Functions

 parse_error (int id_, std::size_t byte_, const char *what_arg)

Static Private Member Functions

static std::string position_string (const position_t &pos)

Additional Inherited Members

Public Member Functions inherited from detail::exception
const char * what () const noexcept override
 returns the explanatory string
Protected Member Functions inherited from detail::exception
 exception (int id_, const char *what_arg)
Static Protected Member Functions inherited from detail::exception
static std::string name (const std::string &ename, int id_)
static std::string diagnostics (std::nullptr_t)
template<typename BasicJsonType>
static std::string diagnostics (const BasicJsonType *leaf_element)

Detailed Description

exception indicating a parse error

See also
https://json.nlohmann.me/api/basic_json/parse_error/

Definition at line 4469 of file json.hpp.

Constructor & Destructor Documentation

◆ parse_error()

detail::parse_error::parse_error ( int id_,
std::size_t byte_,
const char * what_arg )
inlineprivate

Definition at line 4510 of file json.hpp.

References byte, and detail::exception::exception().

Referenced by create(), and create().

Member Function Documentation

◆ create() [1/2]

template<typename BasicJsonContext, enable_if_t< is_basic_json_context< BasicJsonContext >::value, int > = 0>
parse_error detail::parse_error::create ( int id_,
const position_t & pos,
const std::string & what_arg,
BasicJsonContext context )
inlinestatic

create a parse error exception

Parameters
[in]id_the id of the exception
[in]posthe position where the error occurred (or with chars_read_total=0 if the position cannot be determined)
[in]what_argthe explanatory string
Returns
parse_error object

Definition at line 4482 of file json.hpp.

References detail::position_t::chars_read_total, detail::concat(), detail::exception::diagnostics(), detail::exception::name(), parse_error(), and position_string().

Referenced by array_index(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_bson_binary(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_bson_string(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_cbor_binary(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_cbor_string(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_msgpack_string(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_array(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_high_precision_number(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_object(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_size_type(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_size_value(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_string(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::get_ubjson_value(), detail::parser< BasicJsonType, InputAdapterType >::parse(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::parse_bson_element_internal(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::parse_cbor_internal(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::parse_msgpack_internal(), detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::sax_parse(), detail::parser< BasicJsonType, InputAdapterType >::sax_parse(), detail::parser< BasicJsonType, InputAdapterType >::sax_parse_internal(), split(), and detail::binary_reader< BasicJsonType, InputAdapterType, SAX >::unexpect_eof().

◆ create() [2/2]

template<typename BasicJsonContext, enable_if_t< is_basic_json_context< BasicJsonContext >::value, int > = 0>
parse_error detail::parse_error::create ( int id_,
std::size_t byte_,
const std::string & what_arg,
BasicJsonContext context )
inlinestatic

◆ position_string()

std::string detail::parse_error::position_string ( const position_t & pos)
inlinestaticprivate

Member Data Documentation

◆ byte

const std::size_t detail::parse_error::byte

byte index of the parse error

The byte index of the last read character in the input file.

Note
For an input with n bytes, 1 is the index of the first character and n+1 is the index of the terminating null byte or the end of file. This also holds true when reading a byte vector (CBOR or MessagePack).

Definition at line 4507 of file json.hpp.

Referenced by parse_error().


The documentation for this class was generated from the following file:
  • daq-server/diablo_server/lib/include/nlohmann/json.hpp