| 2242 | // global functions |
| 2243 | |
| 2244 | bool parseFromStream(CharReader::Factory const& fact, |
| 2245 | JSONCPP_ISTREAM& sin, |
| 2246 | Value* root, |
| 2247 | JSONCPP_STRING* errs) { |
| 2248 | JSONCPP_OSTRINGSTREAM ssin; |
| 2249 | ssin << sin.rdbuf(); |
| 2250 | JSONCPP_STRING doc = ssin.str(); |
| 2251 | char const* begin = doc.data(); |
| 2252 | char const* end = begin + doc.size(); |
| 2253 | // Note that we do not actually need a null-terminator. |
| 2254 | CharReaderPtr const reader(fact.newCharReader()); |
| 2255 | return reader->parse(begin, end, root, errs); |
| 2256 | } |
| 2257 | |
| 2258 | JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) { |
| 2259 | CharReaderBuilder b; |
no test coverage detected