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