Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | List of all members
nlohmann::detail::parse_error Class Reference

exception indicating a parse error More...

#include <json.hpp>

Inheritance diagram for nlohmann::detail::parse_error:
Inheritance graph
[legend]

Static Public Member Functions

template<typename BasicJsonType >
static parse_error create (int id_, const position_t &pos, const std::string &what_arg, const BasicJsonType &context)
 create a parse error exception More...
 
template<typename BasicJsonType >
static parse_error create (int id_, std::size_t byte_, const std::string &what_arg, const BasicJsonType &context)
 

Public Attributes

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

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 nlohmann::detail::exception
const char * what () const noexcept override
 returns the explanatory string More...
 
- Protected Member Functions inherited from nlohmann::detail::exception
 exception (int id_, const char *what_arg)
 
- Static Protected Member Functions inherited from nlohmann::detail::exception
template<typename BasicJsonType >
static std::string diagnostics (const BasicJsonType &leaf_element)
 
static std::string name (const std::string &ename, int id_)
 

Detailed Description

exception indicating a parse error

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

Definition at line 2900 of file json.hpp.

Constructor & Destructor Documentation

◆ parse_error()

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

Definition at line 2941 of file json.hpp.

Member Function Documentation

◆ create() [1/2]

template<typename BasicJsonType >
static parse_error nlohmann::detail::parse_error::create ( int  id_,
const position_t pos,
const std::string &  what_arg,
const BasicJsonType &  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 2913 of file json.hpp.

◆ create() [2/2]

template<typename BasicJsonType >
static parse_error nlohmann::detail::parse_error::create ( int  id_,
std::size_t  byte_,
const std::string &  what_arg,
const BasicJsonType &  context 
)
inlinestatic

Definition at line 2921 of file json.hpp.

◆ position_string()

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

Definition at line 2944 of file json.hpp.

Member Data Documentation

◆ byte

const std::size_t nlohmann::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 2938 of file json.hpp.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:52