Json API for C++
JsonApi helps C++ developers to parse JSON string, or create JSON string. File list: JsonApi.h JsonApi.lib JsonApi.dll Sample code for parse an JSON string: const char* jsonSrcString = ""; //assume initialized JsonApi::JsonValue jval; jval.parse(jsonSrcString); printf("%s\r\n", jval.toStri ng_styled().getValue()); jval.toFile_styled(".\\json.txt"); Sample code for create an JSON string: JsonApi::JsonValue jval; jval["id"] = 10005; jval["key"] = "value"; jval["array"].append("item1"); jval["array"].append("item2"); jval["array"].append(2000); printf("%s\r\n", jval.toString_styled().getValue()); jval.toFile_styled(".\\json.txt"); ng_styled().getValue()); jval.toFile_styled(".\\json.txt"); Sample code for create an JSON string: JsonApi::JsonValue jval; jval["id"] = 10005; jval["key"] = "value"; jval["array"].append("item1"); jval["array"].append("item2"); jval["array"].append(2000); printf("%s\r\n", jval.toString_styled().getValue()); jval.toFile_styled(".\\json.txt");
用户评论