MCPcopy Create free account
hub / github.com/Illumina/paragraph / writeCommentBeforeValue

Method writeCommentBeforeValue

external/jsoncpp/jsoncpp.cpp:4728–4746  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4726}
4727
4728void StyledWriter::writeCommentBeforeValue(const Value& root) {
4729 if (!root.hasComment(commentBefore))
4730 return;
4731
4732 document_ += "\n";
4733 writeIndent();
4734 const JSONCPP_STRING& comment = root.getComment(commentBefore);
4735 JSONCPP_STRING::const_iterator iter = comment.begin();
4736 while (iter != comment.end()) {
4737 document_ += *iter;
4738 if (*iter == '\n' &&
4739 ((iter+1) != comment.end() && *(iter + 1) == '/'))
4740 writeIndent();
4741 ++iter;
4742 }
4743
4744 // Comments are stripped of trailing newlines, so add one here
4745 document_ += "\n";
4746}
4747
4748void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
4749 if (root.hasComment(commentAfterOnSameLine))

Callers

nothing calls this directly

Calls 4

hasCommentMethod · 0.80
getCommentMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected