djson
v3.1.3
JSON parser
Loading...
Searching...
No Matches
error.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
djson/src_loc.hpp
>
3
#include <string>
4
5
namespace
dj
{
8
struct
Error
{
9
enum class
Type
: std::int8_t {
10
Unknown
,
11
UnrecognizedToken
,
12
MissingClosingQuote
,
13
InvalidNumber
,
14
InvalidEscape
,
15
UnexpectedToken
,
16
UnexpectedComment
,
17
UnexpectedEof
,
18
MissingKey
,
19
MissingColon
,
20
MissingBrace
,
21
MissingBracket
,
22
MissingEndComment
,
23
IoError
,
24
UnsupportedFeature
,
25
COUNT_
,
26
};
27
28
Type
type
{
Type::Unknown
};
29
std::string
token
{};
30
SrcLoc
src_loc
{};
31
};
32
34
auto
to_string_view
(
Error::Type
type) -> std::string_view;
35
37
auto
to_string
(
Error
const
& error) -> std::string;
38
}
// namespace dj
dj
Definition
error.hpp:5
dj::to_string
auto to_string(Error const &error) -> std::string
Obtain print-friendly error string.
dj::to_string_view
auto to_string_view(Error::Type type) -> std::string_view
Obtain stringified Error Type.
src_loc.hpp
dj::Error
Various kinds of parse and IO errors. Contains contextual token and source location if parse error.
Definition
error.hpp:8
dj::Error::token
std::string token
Definition
error.hpp:29
dj::Error::type
Type type
Definition
error.hpp:28
dj::Error::src_loc
SrcLoc src_loc
Definition
error.hpp:30
dj::Error::Type
Type
Definition
error.hpp:9
dj::Error::Type::MissingClosingQuote
@ MissingClosingQuote
dj::Error::Type::COUNT_
@ COUNT_
dj::Error::Type::UnsupportedFeature
@ UnsupportedFeature
dj::Error::Type::MissingKey
@ MissingKey
dj::Error::Type::Unknown
@ Unknown
dj::Error::Type::InvalidEscape
@ InvalidEscape
dj::Error::Type::InvalidNumber
@ InvalidNumber
dj::Error::Type::UnexpectedComment
@ UnexpectedComment
dj::Error::Type::MissingEndComment
@ MissingEndComment
dj::Error::Type::UnexpectedEof
@ UnexpectedEof
dj::Error::Type::MissingColon
@ MissingColon
dj::Error::Type::UnexpectedToken
@ UnexpectedToken
dj::Error::Type::MissingBrace
@ MissingBrace
dj::Error::Type::MissingBracket
@ MissingBracket
dj::Error::Type::UnrecognizedToken
@ UnrecognizedToken
dj::Error::Type::IoError
@ IoError
dj::SrcLoc
Source location.
Definition
src_loc.hpp:6
lib
include
djson
error.hpp
Generated by
1.9.8