| 37 | } |
| 38 | |
| 39 | void OGRSpec::validateInput(const std::string& ogrJsonStr) |
| 40 | { |
| 41 | try |
| 42 | { |
| 43 | m_json = NL::json::parse(ogrJsonStr); |
| 44 | } |
| 45 | catch(NL::json::parse_error& e) |
| 46 | { |
| 47 | std::string s(e.what()); |
| 48 | auto pos = s.find("]"); |
| 49 | if (pos != std::string::npos) |
| 50 | s = s.substr(pos + 1); |
| 51 | std::stringstream msg; |
| 52 | |
| 53 | msg << "Failed to parse OGR JSON with error: " << s; |
| 54 | throw error(msg.str()); |
| 55 | } |
| 56 | parse(); |
| 57 | } |
| 58 | |
| 59 | void OGRSpec::validateInput(const NL::json& ogrJson) |
| 60 | { |