| 2034 | // global functions |
| 2035 | |
| 2036 | bool parseFromStream( |
| 2037 | CharReader::Factory const& fact, JSONCPP_ISTREAM& sin, |
| 2038 | Value* root, JSONCPP_STRING* errs) |
| 2039 | { |
| 2040 | JSONCPP_OSTRINGSTREAM ssin; |
| 2041 | ssin << sin.rdbuf(); |
| 2042 | JSONCPP_STRING doc = ssin.str(); |
| 2043 | char const* begin = doc.data(); |
| 2044 | char const* end = begin + doc.size(); |
| 2045 | // Note that we do not actually need a null-terminator. |
| 2046 | CharReaderPtr const reader(fact.newCharReader()); |
| 2047 | return reader->parse(begin, end, root, errs); |
| 2048 | } |
| 2049 | |
| 2050 | JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) { |
| 2051 | CharReaderBuilder b; |
no test coverage detected