LeviLamina
Loading...
Searching...
No Matches
Reader.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
7namespace Json { class Features; }
8namespace Json { class Value; }
9// clang-format on
10
11namespace Json {
12
13class Reader {
14public:
15 // Reader inner types declare
16 // clang-format off
17 class ErrorInfo;
18 class Token;
19 // clang-format on
20
21 // Reader inner types define
22 using Char = char;
23
24 using Location = char const*;
25
26 enum class TokenType : int {
27 TokenEndOfStream = 0,
28 TokenObjectBegin = 1,
29 TokenObjectEnd = 2,
30 TokenArrayBegin = 3,
31 TokenArrayEnd = 4,
32 TokenString = 5,
33 TokenNumber = 6,
34 TokenTrue = 7,
35 TokenFalse = 8,
36 TokenNull = 9,
37 TokenArraySeparator = 10,
38 TokenMemberSeparator = 11,
39 TokenComment = 12,
40 TokenError = 13,
41 };
42
43 class Token {
44 public:
45 // member variables
46 // NOLINTBEGIN
47 ::ll::TypedStorage<4, 4, ::Json::Reader::TokenType> type_;
48 ::ll::TypedStorage<8, 8, char const*> start_;
49 ::ll::TypedStorage<8, 8, char const*> end_;
50 ::ll::TypedStorage<1, 1, bool> stringHasEscape_;
51 // NOLINTEND
52 };
53
54 class ErrorInfo {
55 public:
56 // member variables
57 // NOLINTBEGIN
58 ::ll::TypedStorage<8, 32, ::Json::Reader::Token> token_;
59 ::ll::TypedStorage<8, 32, ::std::string> message_;
60 ::ll::TypedStorage<8, 8, char const*> extra_;
61 // NOLINTEND
62
63 public:
64 // member functions
65 // NOLINTBEGIN
66 MCAPI ~ErrorInfo();
67 // NOLINTEND
68
69 public:
70 // destructor thunk
71 // NOLINTBEGIN
72 MCFOLD void $dtor();
73 // NOLINTEND
74 };
75
76 using Errors = ::std::deque<::Json::Reader::ErrorInfo>;
77
78 using Nodes = ::std::stack<::Json::Value*, ::std::deque<::Json::Value*>>;
79
80public:
81 // member variables
82 // NOLINTBEGIN
83 ::ll::TypedStorage<8, 40, ::std::stack<::Json::Value*, ::std::deque<::Json::Value*>>> nodes_;
84 ::ll::TypedStorage<8, 40, ::std::deque<::Json::Reader::ErrorInfo>> errors_;
85 ::ll::TypedStorage<8, 32, ::std::string> document_;
86 ::ll::TypedStorage<8, 8, char const*> begin_;
87 ::ll::TypedStorage<8, 8, char const*> end_;
88 ::ll::TypedStorage<8, 8, char const*> current_;
89 ::ll::TypedStorage<8, 8, char const*> lastValueEnd_;
90 ::ll::TypedStorage<8, 8, ::Json::Value*> lastValue_;
91 ::ll::TypedStorage<8, 32, ::std::string> commentsBefore_;
92 ::ll::TypedStorage<1, 2, ::Json::Features> features_;
93 ::ll::TypedStorage<1, 1, bool> collectComments_;
94 // NOLINTEND
95
96public:
97 // member functions
98 // NOLINTBEGIN
99 MCAPI Reader();
100
101 MCAPI explicit Reader(::Json::Features const& features);
102
103 MCAPI bool addError(::std::string const& message, ::Json::Reader::Token& token, char const* extra);
104
105 MCAPI ::Json::Value decodeDouble(::Json::Reader::Token& token, bool& successful);
106
107 MCAPI ::Json::Value decodeNumber(::Json::Reader::Token& token, bool& successful);
108
109 MCAPI bool decodeString(::Json::Reader::Token& token, char* decoded);
110
111 MCAPI bool
112 decodeUnicodeCodePoint(::Json::Reader::Token& token, char const*& current, char const* end, uint& unicode);
113
114 MCAPI bool
115 decodeUnicodeEscapeSequence(::Json::Reader::Token& token, char const*& current, char const* end, uint& unicode);
116
117 MCAPI ::std::string getFormattedErrorMessages() const;
118
119 MCAPI ::std::string getLocationLineAndColumn(char const* location) const;
120
121 MCAPI bool parse(::std::string const& document, ::Json::Value& root, bool collectComments);
122
123 MCAPI bool parse(::std::istream& sin, ::Json::Value& root, bool collectComments);
124
125 MCAPI bool parse(char const* beginDoc, char const* endDoc, ::Json::Value& root, bool);
126
127 MCAPI bool parse(char const* originalBegin, uint64 length, ::Json::Value& root, bool collectComments);
128
129 MCAPI ::Json::Value readArray(::Json::Reader::Token& ok, bool&);
130
131 MCAPI ::Json::Value readObject(::Json::Reader::Token& successful, bool&);
132
133 MCAPI bool readToken(::Json::Reader::Token& token);
134
135 MCAPI ::Json::Value readValue(bool& successful);
136
137 MCAPI bool recoverFromError(::Json::Reader::TokenType skipUntilToken);
138
139 MCAPI ~Reader();
140 // NOLINTEND
141
142public:
143 // constructor thunks
144 // NOLINTBEGIN
145 MCAPI void* $ctor();
146
147 MCAPI void* $ctor(::Json::Features const& features);
148 // NOLINTEND
149
150public:
151 // destructor thunk
152 // NOLINTBEGIN
153 MCAPI void $dtor();
154 // NOLINTEND
155};
156
157} // namespace Json
Definition Features.h:7
Definition Reader.h:54
Definition Reader.h:43
Definition Reader.h:13
Definition Value.h:16