mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-18 03:29:46 +02:00
JSONCPP_OSTREAM
This commit is contained in:
@@ -608,7 +608,7 @@ StyledStreamWriter::StyledStreamWriter(std::string indentation)
|
||||
: document_(NULL), rightMargin_(74), indentation_(indentation),
|
||||
addChildValues_() {}
|
||||
|
||||
void StyledStreamWriter::write(std::ostream& out, const Value& root) {
|
||||
void StyledStreamWriter::write(JSONCPP_OSTREAM& out, const Value& root) {
|
||||
document_ = &out;
|
||||
addChildValues_ = false;
|
||||
indentString_ = "";
|
||||
@@ -839,7 +839,7 @@ struct BuiltStyledStreamWriter : public StreamWriter
|
||||
std::string const& endingLineFeedSymbol,
|
||||
bool useSpecialFloats,
|
||||
unsigned int precision);
|
||||
int write(Value const& root, std::ostream* sout) override;
|
||||
int write(Value const& root, JSONCPP_OSTREAM* sout) override;
|
||||
private:
|
||||
void writeValue(Value const& value);
|
||||
void writeArrayValue(Value const& value);
|
||||
@@ -888,7 +888,7 @@ BuiltStyledStreamWriter::BuiltStyledStreamWriter(
|
||||
, precision_(precision)
|
||||
{
|
||||
}
|
||||
int BuiltStyledStreamWriter::write(Value const& root, std::ostream* sout)
|
||||
int BuiltStyledStreamWriter::write(Value const& root, JSONCPP_OSTREAM* sout)
|
||||
{
|
||||
sout_ = sout;
|
||||
addChildValues_ = false;
|
||||
@@ -1206,7 +1206,7 @@ std::string writeString(StreamWriter::Factory const& builder, Value const& root)
|
||||
return sout.str();
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& sout, Value const& root) {
|
||||
JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM& sout, Value const& root) {
|
||||
StreamWriterBuilder builder;
|
||||
StreamWriterPtr const writer(builder.newStreamWriter());
|
||||
writer->write(root, &sout);
|
||||
|
Reference in New Issue
Block a user