MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / writeCommentBeforeValue

Method writeCommentBeforeValue

Sources/Dependencies/jsoncpp/writer.cpp:588–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586 }
587
588 void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) {
589 if (cs_ == CommentStyle::None)
590 return;
591 if (!root.hasComment(commentBefore))
592 return;
593
594 if (!indented_)
595 writeIndent();
596 const StringContainer& comment = root.getComment(commentBefore);
597 if (comment != "\n") {
598 StringContainer::const_iterator iter = comment.begin();
599 while (iter != comment.end()) {
600 *sout_ << *iter;
601 if (*iter == '\n' && ((iter + 1) != comment.end() && *(iter + 1) == '/'))
602 // writeIndent(); // would write extra newline
603 *sout_ << indentString_;
604 ++iter;
605 }
606 }
607 indented_ = false;
608 }
609
610 void BuiltStyledStreamWriter::writeCommentAfterValueOnSameLine(Value const& root) {
611 if (cs_ == CommentStyle::None)

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