Answer the question
In order to leave comments, you need to log in
How to create a string using the rapidjson library for example for a vector of strings?
There is vector <string> m_paths
rapidjson::Document jsonfile;
jsonfile.SetObject();
rapidjson::Document::AllocatorType& jsonallocator = jsonfile.GetAllocator();
std::vector<String>::iterator itm;
rapidjson::Value paths(rapidjson::kArrayType);
for(itm = m_paths.begin(); itm != m_paths.end(); ++itm)
{
//rapidjson::Value jValueConverting;
// jValueConverting.SetString(GetLogRpl().c_str(), (rapidjson::SizeType)GetLogRpl().size(), jsonallocator);
}
jsonfile.AddMember("paths", paths, jsonallocator);
rapidjson::StringBuffer jsonstring;
rapidjson::Writer<rapidjson::StringBuffer> jsonwriter(jsonstring);
jsonfile.Accept(jsonwriter);
String fullJsonString = jsonstring.GetString();
return fullJsonString;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question