| 625 | } |
| 626 | |
| 627 | static JSON parse_bool( const std::string &str, size_t &offset ) { |
| 628 | if( str.substr( offset, 4 ) == "true" ) { |
| 629 | offset += 4; |
| 630 | return JSON(true); |
| 631 | } else if( str.substr( offset, 5 ) == "false" ) { |
| 632 | offset += 5; |
| 633 | return JSON(false); |
| 634 | } else { |
| 635 | throw std::runtime_error(std::string("JSON ERROR: Bool: Expected 'true' or 'false', found '") + str.substr( offset, 5 ) + "'"); |
| 636 | } |
| 637 | } |
| 638 | |
| 639 | static JSON parse_null( const std::string &str, size_t &offset ) { |
| 640 | if( str.substr( offset, 4 ) != "null" ) { |