MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / writeCommentBeforeValue

Method writeCommentBeforeValue

src/share/jsoncpp/jsoncpp.cpp:4653–4671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4651}
4652
4653void StyledWriter::writeCommentBeforeValue(const Value& root) {
4654 if (!root.hasComment(commentBefore))
4655 return;
4656
4657 document_ += "\n";
4658 writeIndent();
4659 const JSONCPP_STRING& comment = root.getComment(commentBefore);
4660 JSONCPP_STRING::const_iterator iter = comment.begin();
4661 while (iter != comment.end()) {
4662 document_ += *iter;
4663 if (*iter == '\n' &&
4664 (iter != comment.end() && *(iter + 1) == '/'))
4665 writeIndent();
4666 ++iter;
4667 }
4668
4669 // Comments are stripped of trailing newlines, so add one here
4670 document_ += "\n";
4671}
4672
4673void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
4674 if (root.hasComment(commentAfterOnSameLine))

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected