mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-14 18:07:56 +08:00
JSONCPP_ISTREAM
This commit is contained in:
parent
1e990640a9
commit
b84e0c159d
@ -99,7 +99,7 @@ public:
|
|||||||
|
|
||||||
/// \brief Parse from input stream.
|
/// \brief Parse from input stream.
|
||||||
/// \see Json::operator>>(std::istream&, Json::Value&).
|
/// \see Json::operator>>(std::istream&, Json::Value&).
|
||||||
bool parse(std::istream& is, Value& root, bool collectComments = true);
|
bool parse(JSONCPP_ISTREAM& is, Value& root, bool collectComments = true);
|
||||||
|
|
||||||
/** \brief Returns a user friendly string that list errors in the parsed
|
/** \brief Returns a user friendly string that list errors in the parsed
|
||||||
* document.
|
* document.
|
||||||
@ -366,7 +366,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool JSON_API parseFromStream(
|
bool JSON_API parseFromStream(
|
||||||
CharReader::Factory const&,
|
CharReader::Factory const&,
|
||||||
std::istream&,
|
JSONCPP_ISTREAM&,
|
||||||
Value* root, std::string* errs);
|
Value* root, std::string* errs);
|
||||||
|
|
||||||
/** \brief Read from 'sin' into 'root'.
|
/** \brief Read from 'sin' into 'root'.
|
||||||
@ -393,7 +393,7 @@ bool JSON_API parseFromStream(
|
|||||||
\throw std::exception on parse error.
|
\throw std::exception on parse error.
|
||||||
\see Json::operator<<()
|
\see Json::operator<<()
|
||||||
*/
|
*/
|
||||||
JSON_API std::istream& operator>>(std::istream&, Value&);
|
JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
|
||||||
|
|
||||||
} // namespace Json
|
} // namespace Json
|
||||||
|
|
||||||
|
@ -2007,7 +2007,7 @@ void CharReaderBuilder::setDefaults(Json::Value* settings)
|
|||||||
// global functions
|
// global functions
|
||||||
|
|
||||||
bool parseFromStream(
|
bool parseFromStream(
|
||||||
CharReader::Factory const& fact, std::istream& sin,
|
CharReader::Factory const& fact, JSONCPP_ISTREAM& sin,
|
||||||
Value* root, std::string* errs)
|
Value* root, std::string* errs)
|
||||||
{
|
{
|
||||||
JSONCPP_OSTRINGSTREAM ssin;
|
JSONCPP_OSTRINGSTREAM ssin;
|
||||||
@ -2020,7 +2020,7 @@ bool parseFromStream(
|
|||||||
return reader->parse(begin, end, root, errs);
|
return reader->parse(begin, end, root, errs);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::istream& operator>>(std::istream& sin, Value& root) {
|
JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) {
|
||||||
CharReaderBuilder b;
|
CharReaderBuilder b;
|
||||||
std::string errs;
|
std::string errs;
|
||||||
bool ok = parseFromStream(b, sin, &root, &errs);
|
bool ok = parseFromStream(b, sin, &root, &errs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user