| 1962 | // global functions |
| 1963 | |
| 1964 | bool parseFromStream( |
| 1965 | CharReader::Factory const& fact, std::istream& sin, |
| 1966 | Value* root, std::string* errs) { |
| 1967 | std::ostringstream ssin; |
| 1968 | ssin << sin.rdbuf(); |
| 1969 | std::string doc = ssin.str(); |
| 1970 | char const* begin = doc.data(); |
| 1971 | char const* end = begin + doc.size(); |
| 1972 | // Note that we do not actually need a null-terminator. |
| 1973 | CharReaderPtr const reader(fact.newCharReader()); |
| 1974 | return reader->parse(begin, end, root, errs); |
| 1975 | } |
| 1976 | |
| 1977 | std::istream& operator>>(std::istream& sin, Value& root) { |
| 1978 | CharReaderBuilder b; |
no test coverage detected