Skip to content

Commit 3ce9872

Browse files
committed
Revert "added option to FastWriter which omits the trailing new line character"
This reverts commit 5bf1610.
1 parent 598eca2 commit 3ce9872

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

include/json/writer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ class JSON_API FastWriter : public Writer {
165165
*/
166166
void dropNullPlaceholders();
167167

168-
void omitEndingLineFeed();
169-
170168
public: // overridden from Writer
171169
virtual std::string write(const Value& root);
172170

@@ -176,7 +174,6 @@ class JSON_API FastWriter : public Writer {
176174
std::string document_;
177175
bool yamlCompatiblityEnabled_;
178176
bool dropNullPlaceholders_;
179-
bool omitEndingLineFeed_;
180177
};
181178

182179
/** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a

src/lib_json/json_writer.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,20 +279,16 @@ Writer::~Writer() {}
279279
// //////////////////////////////////////////////////////////////////
280280

281281
FastWriter::FastWriter()
282-
: yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false),
283-
omitEndingLineFeed_(false) {}
282+
: yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false) {}
284283

285284
void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; }
286285

287286
void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; }
288287

289-
void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; }
290-
291288
std::string FastWriter::write(const Value& root) {
292289
document_ = "";
293290
writeValue(root);
294-
if (!omitEndingLineFeed_)
295-
document_ += "\n";
291+
document_ += "\n";
296292
return document_;
297293
}
298294

0 commit comments

Comments
 (0)