How to get JsonCPP values as strings?

后端 未结 2 1862
耶瑟儿~
耶瑟儿~ 2021-01-12 15:04

I am parsing json data using JsonCpp. I don\'t really need to understand the data, i just need to print out some properties and their values out. It somehow is hard to do. F

2条回答
  •  时光取名叫无心
    2021-01-12 15:16

    The project has moved to GitHub.

    To avoid all linefeeds, use a StreamWriterBuilder:

    Json::Value whatever = ...;
    Json::StreamWriterBuilder builder;
    builder.settings_["indentation"] = "";
    std::string out = Json::writeString(builder, whatever);
    

提交回复
热议问题