| 31 | #include <iostream> |
| 32 | |
| 33 | void testJSON() { |
| 34 | std::string testString = "{ \"encoding\" : \"UTF-8\", \"plug-ins\" : [ \"python\", \"c++\", \"ruby\" ],\"indent\" : { \"length\" : 3, \"use_space\": true } }"; |
| 35 | |
| 36 | Json::Value root; |
| 37 | |
| 38 | // Json::Value::Members members = root.getMemberNames(); |
| 39 | |
| 40 | Json::Reader reader; |
| 41 | |
| 42 | if (reader.parse(testString, root)) { |
| 43 | std::cout << "Parse ok" << std::endl; |
| 44 | } else { |
| 45 | std::cout << "Parse NOT ok" << std::endl; |
| 46 | } |
| 47 | |
| 48 | Json::ValueType type = root.type(); |
| 49 | |
| 50 | std::cout << "Type is: " << type << std::endl; |
| 51 | |
| 52 | // std::cout << root.asString() << std::endl; |
| 53 | |
| 54 | Json::Value::Members members = root.getMemberNames(); |
| 55 | |
| 56 | for (auto& member : members) { |
| 57 | std::cout << member << std::endl; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | /******* |
| 62 | * |
nothing calls this directly
no test coverage detected