mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-06-08 09:27:50 +02:00
"\n" -> '\n'
This commit is contained in:
parent
c00a3b95c2
commit
745287275c
@ -1491,7 +1491,7 @@ JSONCPP_STRING Value::toStyledString() const {
|
|||||||
|
|
||||||
JSONCPP_STRING out = this->hasComment(commentBefore) ? "\n" : "";
|
JSONCPP_STRING out = this->hasComment(commentBefore) ? "\n" : "";
|
||||||
out += Json::writeString(builder, *this);
|
out += Json::writeString(builder, *this);
|
||||||
out += "\n";
|
out += '\n';
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ JSONCPP_STRING FastWriter::write(const Value& root) {
|
|||||||
document_.clear();
|
document_.clear();
|
||||||
writeValue(root);
|
writeValue(root);
|
||||||
if (!omitEndingLineFeed_)
|
if (!omitEndingLineFeed_)
|
||||||
document_ += "\n";
|
document_ += '\n';
|
||||||
return document_;
|
return document_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,7 +438,7 @@ JSONCPP_STRING StyledWriter::write(const Value& root) {
|
|||||||
writeCommentBeforeValue(root);
|
writeCommentBeforeValue(root);
|
||||||
writeValue(root);
|
writeValue(root);
|
||||||
writeCommentAfterValueOnSameLine(root);
|
writeCommentAfterValueOnSameLine(root);
|
||||||
document_ += "\n";
|
document_ += '\n';
|
||||||
return document_;
|
return document_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -608,7 +608,7 @@ void StyledWriter::writeCommentBeforeValue(const Value& root) {
|
|||||||
if (!root.hasComment(commentBefore))
|
if (!root.hasComment(commentBefore))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
document_ += "\n";
|
document_ += '\n';
|
||||||
writeIndent();
|
writeIndent();
|
||||||
const JSONCPP_STRING& comment = root.getComment(commentBefore);
|
const JSONCPP_STRING& comment = root.getComment(commentBefore);
|
||||||
JSONCPP_STRING::const_iterator iter = comment.begin();
|
JSONCPP_STRING::const_iterator iter = comment.begin();
|
||||||
@ -620,7 +620,7 @@ void StyledWriter::writeCommentBeforeValue(const Value& root) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Comments are stripped of trailing newlines, so add one here
|
// Comments are stripped of trailing newlines, so add one here
|
||||||
document_ += "\n";
|
document_ += '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
|
void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
|
||||||
@ -628,9 +628,9 @@ void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
|
|||||||
document_ += " " + root.getComment(commentAfterOnSameLine);
|
document_ += " " + root.getComment(commentAfterOnSameLine);
|
||||||
|
|
||||||
if (root.hasComment(commentAfter)) {
|
if (root.hasComment(commentAfter)) {
|
||||||
document_ += "\n";
|
document_ += '\n';
|
||||||
document_ += root.getComment(commentAfter);
|
document_ += root.getComment(commentAfter);
|
||||||
document_ += "\n";
|
document_ += '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user