Skip to content

Commit eac41ec

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

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
@@ -160,8 +160,6 @@ class JSON_API FastWriter : public Writer {
160160
*/
161161
void dropNullPlaceholders();
162162

163-
void omitEndingLineFeed();
164-
165163
public: // overridden from Writer
166164
virtual std::string write(const Value& root);
167165

@@ -171,7 +169,6 @@ class JSON_API FastWriter : public Writer {
171169
std::string document_;
172170
bool yamlCompatiblityEnabled_;
173171
bool dropNullPlaceholders_;
174-
bool omitEndingLineFeed_;
175172
};
176173

177174
/** \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
@@ -192,20 +192,16 @@ Writer::~Writer() {}
192192
// //////////////////////////////////////////////////////////////////
193193

194194
FastWriter::FastWriter()
195-
: yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false),
196-
omitEndingLineFeed_(false) {}
195+
: yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false) {}
197196

198197
void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; }
199198

200199
void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; }
201200

202-
void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; }
203-
204201
std::string FastWriter::write(const Value& root) {
205202
document_ = "";
206203
writeValue(root);
207-
if (!omitEndingLineFeed_)
208-
document_ += "\n";
204+
document_ += "\n";
209205
return document_;
210206
}
211207

0 commit comments

Comments
 (0)