--------------------------------------------------------------
| 34 | |
| 35 | //-------------------------------------------------------------- |
| 36 | bool ofxJSONElement::parse(std::string jsonString) |
| 37 | { |
| 38 | CharReaderBuilder rb; |
| 39 | auto reader = std::unique_ptr<Json::CharReader>(rb.newCharReader()); |
| 40 | Json::String errors; |
| 41 | if (!reader->parse(jsonString.c_str(), |
| 42 | jsonString.c_str() + jsonString.size(), |
| 43 | this, &errors)) |
| 44 | { |
| 45 | ofLog() << "Unable to parse string: " << errors; |
| 46 | return false; |
| 47 | } |
| 48 | return true; |
| 49 | } |
| 50 | |
| 51 | |
| 52 | //-------------------------------------------------------------- |
no test coverage detected