exception indicating a parse error
More...
#include <json.hpp>
|
| const char * | what () const noexcept override |
| | returns the explanatory string
|
| |
|
| 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) |
| |
|
| const std::size_t | byte |
| | byte index of the parse error
|
| |
| const int | id |
| | the id of the exception
|
| |
|
| template<typename BasicJsonType > |
| static std::string | diagnostics (const BasicJsonType *leaf_element) |
| |
| static std::string | diagnostics (std::nullptr_t) |
| |
| static std::string | name (const std::string &ename, int id_) |
| |
|
| | parse_error (int id_, std::size_t byte_, const char *what_arg) |
| |
|
| std::runtime_error | m |
| | an exception object as storage for error messages
|
| |
exception indicating a parse error
- See also
- https://json.nlohmann.me/api/basic_json/parse_error/
Definition at line 4626 of file json.hpp.
◆ parse_error()
| detail::parse_error::parse_error |
( |
int |
id_, |
|
|
std::size_t |
byte_, |
|
|
const char * |
what_arg |
|
) |
| |
|
inlineprivate |
◆ create() [1/2]
| static parse_error detail::parse_error::create |
( |
int |
id_, |
|
|
const position_t & |
pos, |
|
|
const std::string & |
what_arg, |
|
|
BasicJsonContext |
context |
|
) |
| |
|
inlinestatic |
◆ create() [2/2]
| static parse_error detail::parse_error::create |
( |
int |
id_, |
|
|
std::size_t |
byte_, |
|
|
const std::string & |
what_arg, |
|
|
BasicJsonContext |
context |
|
) |
| |
|
inlinestatic |
◆ diagnostics() [1/2]
template<typename BasicJsonType >
| static std::string detail::exception::diagnostics |
( |
const BasicJsonType * |
leaf_element | ) |
|
|
inlinestaticprotectedinherited |
Definition at line 4537 of file json.hpp.
References detail::array, detail::binary, detail::boolean, detail::concat(), detail::discarded, detail::exception::get_byte_positions(), detail::null, detail::number_float, detail::number_integer, detail::number_unsigned, detail::object, and detail::string.
◆ diagnostics() [2/2]
| static std::string detail::exception::diagnostics |
( |
std::nullptr_t |
| ) |
|
|
inlinestaticprotectedinherited |
◆ get_byte_positions()
template<typename BasicJsonType >
| static std::string detail::exception::get_byte_positions |
( |
const BasicJsonType * |
leaf_element | ) |
|
|
inlinestaticprivateinherited |
◆ name()
| static std::string detail::exception::name |
( |
const std::string & |
ename, |
|
|
int |
id_ |
|
) |
| |
|
inlinestaticprotectedinherited |
◆ position_string()
| static std::string detail::parse_error::position_string |
( |
const position_t & |
pos | ) |
|
|
inlinestaticprivate |
◆ what()
| const char * detail::exception::what |
( |
| ) |
const |
|
inlineoverridenoexceptinherited |
◆ 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 4664 of file json.hpp.
◆ id
| const int detail::exception::id |
|
inherited |
the id of the exception
Definition at line 4520 of file json.hpp.
| std::runtime_error detail::exception::m |
|
privateinherited |
The documentation for this class was generated from the following file: