Class parse_error

Inheritance Relationships

Base Type

Class Documentation

class parse_error : public detail::exception

exception indicating a parse error

Public Members

const std::size_t 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).

Public Static Functions

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

create a parse error exception

Parameters:
  • id_[in] the id of the exception

  • pos[in] the position where the error occurred (or with chars_read_total=0 if the position cannot be determined)

  • what_arg[in] the explanatory string

Returns:

parse_error object

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