mardi 26 avril 2016

c++11: json library that implements two simple requirements

I want c++11 json library with such two simple features:

  1. For output allow code like this(usage of json11), with help of std::initializer_list:

    std::cout << json11::Json{
        json11::Json::object {
            { "Key4", json11::Json::object{
                    {"sub key", "data"}
                }}}}
    .dump();
    
    
  2. Allow parse such input data "{\"test1\": \"test1 value\"} {", for example picojson:

    std::string json = "{\"test1\": \"test1 value\"} {";
    picojson::value v;
    std::string err;
    auto it = picojson::parse(v, json.begin(), json.end(), &err);
    
    

as result it(picojson) parse "{\"test1\": \"test1 value\"}" and it point to last symbol('{')

Simple enough requirement I think, but

So anybody know opensource c++11 library that support these two simple requirements?

Aucun commentaire:

Enregistrer un commentaire