| 2206 | // global functions |
| 2207 | |
| 2208 | bool parseFromStream( |
| 2209 | CharReader::Factory const& fact, std::istream& sin, |
| 2210 | Value* root, std::string* errs) |
| 2211 | { |
| 2212 | std::ostringstream ssin; |
| 2213 | ssin << sin.rdbuf(); |
| 2214 | std::string doc = ssin.str(); |
| 2215 | char const* begin = doc.data(); |
| 2216 | char const* end = begin + doc.size(); |
| 2217 | // Note that we do not actually need a null-terminator. |
| 2218 | CharReaderPtr const reader(fact.newCharReader()); |
| 2219 | return reader->parse(begin, end, root, errs); |
| 2220 | } |
| 2221 | |
| 2222 | std::istream& operator>>(std::istream& sin, Value& root) { |
| 2223 | CharReaderBuilder b; |
no test coverage detected