MCPcopy Create free account
hub / github.com/apple/foundationdb / readJSONStrictly

Function readJSONStrictly

fdbclient/StatusClient.actor.cpp:34–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32#include "flow/actorcompiler.h" // has to be last include
33
34json_spirit::mValue readJSONStrictly(const std::string& s) {
35 json_spirit::mValue val;
36 std::string::const_iterator i = s.begin();
37 if (!json_spirit::read_range(i, s.end(), val)) {
38 if (g_network->isSimulated()) {
39 printf("MALFORMED: %s\n", s.c_str());
40 }
41 throw json_malformed();
42 }
43
44 // Allow trailing whitespace
45 while (i != s.end()) {
46 if (!isspace(*i)) {
47 if (g_network->isSimulated()) {
48 printf(
49 "EXPECTED EOF: %s\n^^^\n%s\n", std::string(s.begin(), i).c_str(), std::string(i, s.end()).c_str());
50 }
51 throw json_eof_expected();
52 }
53 ++i;
54 }
55
56 return val;
57}
58
59uint64_t JSONDoc::expires_reference_version = std::numeric_limits<uint64_t>::max();
60

Calls 6

read_rangeFunction · 0.85
printfFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
isSimulatedMethod · 0.45
c_strMethod · 0.45