| 686 | } |
| 687 | |
| 688 | Int64 JSON::toInt() const |
| 689 | { |
| 690 | ElementType type = getType(); |
| 691 | |
| 692 | if (type == TYPE_NUMBER) |
| 693 | return getInt(); |
| 694 | if (type == TYPE_STRING) |
| 695 | return JSON(ptr_begin + 1, ptr_end, level + 1).getInt(); |
| 696 | throw JSONException("JSON: cannot convert value to signed integer."); |
| 697 | } |
| 698 | |
| 699 | UInt64 JSON::toUInt() const |
| 700 | { |