| 32 | #include "flow/actorcompiler.h" // has to be last include |
| 33 | |
| 34 | json_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 | |
| 59 | uint64_t JSONDoc::expires_reference_version = std::numeric_limits<uint64_t>::max(); |
| 60 | |