| 703 | } |
| 704 | |
| 705 | Int64 JSON::toInt() const |
| 706 | { |
| 707 | ElementType type = getType(); |
| 708 | |
| 709 | if (type == TYPE_NUMBER) |
| 710 | return getInt(); |
| 711 | else if (type == TYPE_STRING) |
| 712 | return JSON(ptr_begin + 1, ptr_end, level + 1).getInt(); |
| 713 | else |
| 714 | throw JSONException("JSON: cannot convert value to signed integer."); |
| 715 | } |
| 716 | |
| 717 | UInt64 JSON::toUInt() const |
| 718 | { |