17 lines
439 B
C++
17 lines
439 B
C++
|
#include <libjsonincpp/jsonobj.h>
|
||
|
#include <libjsonincpp/string_representation.h>
|
||
|
#include <assert.h>
|
||
|
|
||
|
using namespace json;
|
||
|
|
||
|
void prettyprint_json(const JSON& obj) {
|
||
|
printf("%s", generate_str(obj, print_pretty).c_str());
|
||
|
}
|
||
|
|
||
|
int main() {
|
||
|
std::string text = "{\"\":\"\", \"true\":true, \"asd\" : { \"aaa\" : [[[[[[[123, 123, 13123123]]]]]]]}} ";
|
||
|
JSON j;
|
||
|
j = parse_str_flawless(text);
|
||
|
prettyprint_json(j);
|
||
|
return 0;
|
||
|
}
|