MCPcopy Create free account
hub / github.com/Kitware/CMake / writeCommentBeforeValue

Method writeCommentBeforeValue

Utilities/cmjsoncpp/src/lib_json/json_writer.cpp:615–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615void StyledWriter::writeCommentBeforeValue(const Value& root) {
616 if (!root.hasComment(commentBefore))
617 return;
618
619 document_ += '\n';
620 writeIndent();
621 const String& comment = root.getComment(commentBefore);
622 String::const_iterator iter = comment.begin();
623 while (iter != comment.end()) {
624 document_ += *iter;
625 if (*iter == '\n' && ((iter + 1) != comment.end() && *(iter + 1) == '/'))
626 writeIndent();
627 ++iter;
628 }
629
630 // Comments are stripped of trailing newlines, so add one here
631 document_ += '\n';
632}
633
634void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
635 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