parseFromStream() copies the document couple of times. To me it does not look like a usable level on high-performance server.
Why parseFromChar and parseFromString are not provided? mapping them to stringstream to use parseFromStrea() costs a lot.
Why CharReader is unable to be created on stack? I cannot understand the benefit to use 'new' for this on-shot object.
parseFromStream() copies the document couple of times. To me it does not look like a usable level on high-performance server.
Json::Value root;
reader->parse(beg, end, &root);
Why CharReader is unable to be created on stack?
An object on the stack cannot have its size changed. Backward-compatibility constrains enhancements, and sometimes even bug-fixes. In the past, that constraint made this library difficult to maintain.
Readers are not thread-safe, but they generally are re-usable. So I don't see the reason for objections.
http://open-source-parsers.github.io/jsoncpp-docs/doxygen/index.html
Json::CharReaderBuilder rbuilder;
std::unique_ptr<Json::CharReader> const reader(rbuilder.newCharReader());
std::string const mystring = whatever;
char const* start = mystring.c_str();
char const* stop = start + mystring.size();
Json::Value value1;
std::string errs;
reader->parse(start, stop, &value1, &errs);
start and stop delimit the string.