I'm trying to use the styled writer in order to create an document,
I haven't seen a code that builds a root without using the reader,
Can I build the root - (Value variable) and initiate it and then use the writer? (without using the reader.parse or at all)
if so can you provide a sample code for building a root for:
{
key : val
}
thanx
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I read the jsoncpp API and wrote a sample code, that creates a json array and populates with string values; then all data is dumped into `fpath` filename.
See also src/jsontestrunner/main.cpp
int write_test_array_22(int limit)
{
char buf[20];
Json::Value root(Json::arrayValue);
for (int i=0; i<limit; i++) {
sprintf(buf, "%09d", i);
root.append(Json::Value(buf));
}
Hi,
I'm trying to use the styled writer in order to create an document,
I haven't seen a code that builds a root without using the reader,
Can I build the root - (Value variable) and initiate it and then use the writer? (without using the reader.parse or at all)
if so can you provide a sample code for building a root for:
{
key : val
}
thanx
Hello,
I read the jsoncpp API and wrote a sample code, that creates a json array and populates with string values; then all data is dumped into `fpath` filename.
See also src/jsontestrunner/main.cpp
int write_test_array_22(int limit)
{
char buf[20];
Json::Value root(Json::arrayValue);
for (int i=0; i<limit; i++) {
sprintf(buf, "%09d", i);
root.append(Json::Value(buf));
}
std::string fpath = "test_array_22.json";
std::string rewrite;
return rewriteValueTree(fpath, root, rewrite);
}