| 2223 | // global functions |
| 2224 | |
| 2225 | bool parseFromStream( |
| 2226 | CharReader::Factory const& fact, JSONCPP_ISTREAM& sin, |
| 2227 | Value* root, JSONCPP_STRING* errs) |
| 2228 | { |
| 2229 | JSONCPP_OSTRINGSTREAM ssin; |
| 2230 | ssin << sin.rdbuf(); |
| 2231 | JSONCPP_STRING doc = ssin.str(); |
| 2232 | char const* begin = doc.data(); |
| 2233 | char const* end = begin + doc.size(); |
| 2234 | // Note that we do not actually need a null-terminator. |
| 2235 | CharReaderPtr const reader(fact.newCharReader()); |
| 2236 | return reader->parse(begin, end, root, errs); |
| 2237 | } |
| 2238 | |
| 2239 | JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) { |
| 2240 | CharReaderBuilder b; |
no test coverage detected