| 1994 | // global functions |
| 1995 | |
| 1996 | bool parseFromStream(CharReader::Factory const& fact, |
| 1997 | JSONCPP_ISTREAM& sin, |
| 1998 | Value* root, |
| 1999 | JSONCPP_STRING* errs) { |
| 2000 | JSONCPP_OSTRINGSTREAM ssin; |
| 2001 | ssin << sin.rdbuf(); |
| 2002 | JSONCPP_STRING doc = ssin.str(); |
| 2003 | char const* begin = doc.data(); |
| 2004 | char const* end = begin + doc.size(); |
| 2005 | // Note that we do not actually need a null-terminator. |
| 2006 | CharReaderPtr const reader(fact.newCharReader()); |
| 2007 | return reader->parse(begin, end, root, errs); |
| 2008 | } |
| 2009 | |
| 2010 | JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) { |
| 2011 | CharReaderBuilder b; |
no test coverage detected