MCPcopy Create free account
hub / github.com/Selectively11/CloudRedirect / parseObject

Method parseObject

src/common/json.cpp:189–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187 }
188
189 Value parseObject() {
190 if (depth >= MAX_DEPTH) return Value();
191 ++depth;
192 next(); // skip {
193 Value v;
194 v.type = Type::Object;
195 skipWs();
196 if (peek() == '}') { next(); --depth; return v; }
197 while (true) {
198 skipWs();
199 if (peek() != '"') break; // key must start with quote
200 auto key = parseString();
201 skipWs();
202 next(); // skip :
203 auto val = parseValue();
204 v.objVal[key.strVal] = std::move(val);
205 skipWs();
206 if (peek() == ',') { next(); continue; }
207 if (peek() == '}') { next(); break; }
208 break;
209 }
210 --depth;
211 return v;
212 }
213};
214
215Value Parse(const std::string& json) {

Callers

nothing calls this directly

Calls 1

ValueClass · 0.85

Tested by

no test coverage detected