mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-03-03 21:06:24 +01:00
Revert "added option to FastWriter which omits the trailing new line character"
This reverts commit 5bf16105b5a90f9fa7d5d4d43452feee46603a52.
This commit is contained in:
parent
00d7bea0f6
commit
254fe6a07a
@ -165,8 +165,6 @@ public:
|
||||
*/
|
||||
void dropNullPlaceholders();
|
||||
|
||||
void omitEndingLineFeed();
|
||||
|
||||
public: // overridden from Writer
|
||||
virtual std::string write(const Value& root);
|
||||
|
||||
@ -176,7 +174,6 @@ private:
|
||||
std::string document_;
|
||||
bool yamlCompatiblityEnabled_;
|
||||
bool dropNullPlaceholders_;
|
||||
bool omitEndingLineFeed_;
|
||||
};
|
||||
|
||||
/** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a
|
||||
|
@ -284,20 +284,16 @@ Writer::~Writer() {}
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
|
||||
FastWriter::FastWriter()
|
||||
: yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false),
|
||||
omitEndingLineFeed_(false) {}
|
||||
: yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false) {}
|
||||
|
||||
void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; }
|
||||
|
||||
void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; }
|
||||
|
||||
void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; }
|
||||
|
||||
std::string FastWriter::write(const Value& root) {
|
||||
document_ = "";
|
||||
writeValue(root);
|
||||
if (!omitEndingLineFeed_)
|
||||
document_ += "\n";
|
||||
document_ += "\n";
|
||||
return document_;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user