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 ErrorInfo;
21 class Token;
22 // clang-format on
23
24 // Reader inner types define
25 using Char = char;
26
27 using Location = char const*;
28
29 enum class TokenType : int {
30 TokenEndOfStream = 0,
31 TokenObjectBegin = 1,
32 TokenObjectEnd = 2,
33 TokenArrayBegin = 3,
34 TokenArrayEnd = 4,
35 TokenString = 5,
36 TokenNumber = 6,
37 TokenTrue = 7,
38 TokenFalse = 8,
39 TokenNull = 9,
40 TokenArraySeparator = 10,
41 TokenMemberSeparator = 11,
42 TokenComment = 12,
43 TokenError = 13,
44 };
45
46 class Token {
47 public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<4, 4, ::Json::Reader::TokenType> type_;
51 ::ll::TypedStorage<8, 8, char const*> start_;
52 ::ll::TypedStorage<8, 8, char const*> end_;
53 ::ll::TypedStorage<1, 1, bool> stringHasEscape_;
54 // NOLINTEND
55 };
56
57 class ErrorInfo {
58 public:
59 // member variables
60 // NOLINTBEGIN
61 ::ll::TypedStorage<8, 32, ::Json::Reader::Token> token_;
62 ::ll::TypedStorage<8, 32, ::std::string> message_;
63 ::ll::TypedStorage<8, 8, char const*> extra_;
64 // NOLINTEND
65
66 public:
67 // member functions
68 // NOLINTBEGIN
69 MCAPI ~ErrorInfo();
70 // NOLINTEND
71
72 public:
73 // destructor thunk
74 // NOLINTBEGIN
75 MCAPI void $dtor();
76 // NOLINTEND
77 };
78
79 using Errors = ::std::deque<::Json::Reader::ErrorInfo>;
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:57
Definition Reader.h:46
Definition Reader.h:16
Definition Value.h:16