| 1980 | // global functions |
| 1981 | |
| 1982 | bool parseFromStream(CharReader::Factory const& fact, IStream& sin, Value* root, |
| 1983 | String* errs) { |
| 1984 | OStringStream ssin; |
| 1985 | ssin << sin.rdbuf(); |
| 1986 | String doc = ssin.str(); |
| 1987 | char const* begin = doc.data(); |
| 1988 | char const* end = begin + doc.size(); |
| 1989 | // Note that we do not actually need a null-terminator. |
| 1990 | CharReaderPtr const reader(fact.newCharReader()); |
| 1991 | return reader->parse(begin, end, root, errs); |
| 1992 | } |
| 1993 | |
| 1994 | IStream& operator>>(IStream& sin, Value& root) { |
| 1995 | CharReaderBuilder b; |
no test coverage detected