Represents a JSON reader which implements Archiver concept.
More...
#include <archiver.h>
Definition at line 56 of file archiver.h.
◆ JsonReader()
JsonReader::JsonReader |
( |
const char * | json | ) |
|
- Parameters
-
json | A non-const source json string for in-situ parsing. |
- Note
- in-situ means the source JSON string will be modified after parsing.
Definition at line 31 of file archiver.cpp.
31 : mDocument(), mStack(), mError(false) {
35 mError = true;
36 else {
39 }
40}
std::stack< JsonReaderStackItem > JsonReaderStack
GenericDocument & Parse(const typename SourceEncoding::Ch *str)
Parse JSON text from a read-only string (with Encoding conversion)
GenericDocument< UTF8<> > Document
GenericDocument with UTF8 encoding.
@ BeforeStart
An object/array is in the stack but it is not yet called by StartObject()/StartArray().
◆ ~JsonReader()
JsonReader::~JsonReader |
( |
| ) |
|
◆ EndArray()
Definition at line 109 of file archiver.cpp.
109 {
110 if (!mError) {
112 Next();
113 else
114 mError = true;
115 }
116 return *this;
117}
@ Closed
An array is closed after read all element, but before EndArray().
◆ EndObject()
Definition at line 58 of file archiver.cpp.
58 {
59 if (!mError) {
61 Next();
62 else
63 mError = true;
64 }
65 return *this;
66}
@ Started
An object/array is called by StartObject()/StartArray().
◆ HasMember()
bool JsonReader::HasMember |
( |
const char * | name | ) |
const |
◆ Member()
JsonReader & JsonReader::Member |
( |
const char * | name | ) |
|
Definition at line 68 of file archiver.cpp.
68 {
69 if (!mError) {
72 if (memberItr !=
CURRENT.MemberEnd())
74 else
75 mError = true;
76 }
77 else
78 mError = true;
79 }
80 return *this;
81}
(Constant) member iterator for a JSON object value
◆ operator bool()
JsonReader::operator bool |
( |
| ) |
const |
|
inline |
◆ operator&() [1/5]
Definition at line 119 of file archiver.cpp.
119 {
120 if (!mError) {
123 Next();
124 }
125 else
126 mError = true;
127 }
128 return *this;
129}
◆ operator&() [2/5]
Definition at line 155 of file archiver.cpp.
155 {
156 if (!mError) {
159 Next();
160 }
161 else
162 mError = true;
163 }
164 return *this;
165}
◆ operator&() [3/5]
Definition at line 143 of file archiver.cpp.
143 {
144 if (!mError) {
147 Next();
148 }
149 else
150 mError = true;
151 }
152 return *this;
153}
◆ operator&() [4/5]
JsonReader & JsonReader::operator& |
( |
std::string & | s | ) |
|
Definition at line 167 of file archiver.cpp.
167 {
168 if (!mError) {
171 Next();
172 }
173 else
174 mError = true;
175 }
176 return *this;
177}
◆ operator&() [5/5]
JsonReader & JsonReader::operator& |
( |
unsigned & | u | ) |
|
Definition at line 131 of file archiver.cpp.
131 {
132 if (!mError) {
135 Next();
136 }
137 else
138 mError = true;
139 }
140 return *this;
141}
◆ SetNull()
Definition at line 179 of file archiver.cpp.
179 {
180
181 mError = true;
182 return *this;
183}
◆ StartArray()
JsonReader & JsonReader::StartArray |
( |
size_t * | size = 0 | ) |
|
Definition at line 89 of file archiver.cpp.
89 {
90 if (!mError) {
93 if (size)
95
99 }
100 else
102 }
103 else
104 mError = true;
105 }
106 return *this;
107}
◆ StartObject()
Definition at line 48 of file archiver.cpp.
48 {
49 if (!mError) {
52 else
53 mError = true;
54 }
55 return *this;
56}
◆ IsReader
const bool JsonReader::IsReader = true |
|
static |
◆ IsWriter
const bool JsonReader::IsWriter = !IsReader |
|
static |
The documentation for this class was generated from the following files:
- libraries/fc/include/fc/crypto/webauthn_json/example/archiver/archiver.h
- libraries/fc/include/fc/crypto/webauthn_json/example/archiver/archiver.cpp