| 350 | |
| 351 | |
| 352 | JSON::Pos JSON::skipObject() const |
| 353 | { |
| 354 | if (!isObject()) |
| 355 | throw JSONException("JSON: expected {"); |
| 356 | Pos pos = ptr_begin; |
| 357 | ++pos; |
| 358 | checkPos(pos); |
| 359 | if (*pos == '}') |
| 360 | return ++pos; |
| 361 | |
| 362 | while (true) |
| 363 | { |
| 364 | pos = JSON(pos, ptr_end, level + 1).skipNameValuePair(); |
| 365 | |
| 366 | checkPos(pos); |
| 367 | |
| 368 | switch (*pos) |
| 369 | { |
| 370 | case ',': |
| 371 | ++pos; |
| 372 | break; |
| 373 | case '}': |
| 374 | return ++pos; |
| 375 | default: |
| 376 | throw JSONException(std::string("JSON: expected one of ',}', got ") + *pos); |
| 377 | } |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | |
| 382 | JSON::Pos JSON::skipElement() const |
nothing calls this directly
no test coverage detected