Argo  1.0
A C++ library for handling JSON.
Public Member Functions | List of all members
argo::json_parser_exception Class Reference

Exception class for parser errors. More...

#include <json_parser_exception.hpp>

Inheritance diagram for argo::json_parser_exception:
argo::json_exception

Public Member Functions

 json_parser_exception (exception_type et, size_t byte_index) noexcept
 
 json_parser_exception (exception_type et, char c, size_t byte_index) noexcept
 
 json_parser_exception (exception_type et, const std::string &s, size_t byte_index) noexcept
 
 json_parser_exception (exception_type et, size_t s, size_t byte_index) noexcept
 
size_t get_byte_index () const noexcept
 Get the (approximate) byte index at which the error occurred.
 
- Public Member Functions inherited from argo::json_exception
 json_exception (exception_type et) noexcept
 
 json_exception (exception_type et, const char *json_type_name) noexcept
 
 json_exception (exception_type et, const char *first_json_type_name, const char *second_json_type_name) noexcept
 
exception_type get_type () const noexcept
 
virtual const char * what () const noexcept
 

Additional Inherited Members

- Public Types inherited from argo::json_exception
enum  exception_type {
  invalid_json_type_e, invalid_key_e, not_an_array_e, not_an_object_e,
  not_number_int_or_boolean_e, not_string_e, not_number_e, array_index_range_e,
  not_number_or_string_e, cant_compare_raw_e, cant_cast_raw_e, types_not_comparable_e,
  pointer_not_matched_e, pointer_token_type_invalid_e, fgetc_failed_e, read_failed_e,
  unexpected_result_from_read_e, write_fd_failed_e, write_file_failed_e, too_many_put_back_e,
  file_open_failed_e, invalid_character_e, invalid_number_e, number_out_of_range_e,
  number_too_long_e, string_too_long_e, unexpected_eof_e, unexpected_token_e,
  message_too_long_e, maximum_nesting_depth_exceeded_e, invalid_string_escape_e, invalid_string_encoding_e,
  invalid_unicode_e, invalid_utf8_char_e, invalid_utf8_sequence_length_e, invalid_hex_char_e,
  invalid_hex_number_e, syntax_error_in_pointer_string_e
}
 
- Static Public Attributes inherited from argo::json_exception
static const int max_message_length = 200
 Maximum length of the message that may be returned by the what() method.
 
- Protected Attributes inherited from argo::json_exception
char m_message [max_message_length]
 
exception_type m_type
 

Detailed Description

Exception class for parser errors.

Definition at line 33 of file json_parser_exception.hpp.

Constructor & Destructor Documentation

json_parser_exception::json_parser_exception ( exception_type  et,
size_t  byte_index 
)
noexcept

Constructor.

Parameters
etType of the exeption.
byte_indexPlace in the input the error occurred.

Definition at line 57 of file json_parser_exception.cpp.

json_parser_exception::json_parser_exception ( exception_type  et,
char  c,
size_t  byte_index 
)
noexcept

Constructor for a character based parser exception.

Parameters
etType of the exeption.
cThe character that caused the exception.
byte_indexPlace in the input the error occurred.

Definition at line 64 of file json_parser_exception.cpp.

json_parser_exception::json_parser_exception ( exception_type  et,
const std::string &  s,
size_t  byte_index 
)
noexcept

Constructor for a parser exception where a string needs to be reported back (e.g. unexpected token).

Parameters
etType of the exeption.
sThe string related to the exception.
byte_indexPlace in the input the error occurred.

Definition at line 71 of file json_parser_exception.cpp.

json_parser_exception::json_parser_exception ( exception_type  et,
size_t  s,
size_t  byte_index 
)
noexcept

Constructor for a parser exception where a size_t needs to be reported back (e.g. too many characters in a string).

Parameters
etType of the exeption.
sThe size_t related to the exception.
byte_indexPlace in the input the error occurred.

Definition at line 78 of file json_parser_exception.cpp.


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