Converting a Json::Value to std::string?

You can use a Json::Writer to do exactly this, since I assume you want to save it somewhere so you don’t want human readable output, your best bet would be to use a Json::FastWriter and then you can call the write method with the parameter of your Json::Value (ie. your root) and then that simply returns a std::string like so:

Json::FastWriter fastWriter;
std::string output = fastWriter.write(root);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)