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

Method writeCommentBeforeValue

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:4703–4720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4701}
4702
4703void StyledWriter::writeCommentBeforeValue(const Value& root) {
4704 if (!root.hasComment(commentBefore))
4705 return;
4706
4707 document_ += '\n';
4708 writeIndent();
4709 const String& comment = root.getComment(commentBefore);
4710 String::const_iterator iter = comment.begin();
4711 while (iter != comment.end()) {
4712 document_ += *iter;
4713 if (*iter == '\n' && ((iter + 1) != comment.end() && *(iter + 1) == '/'))
4714 writeIndent();
4715 ++iter;
4716 }
4717
4718 // Comments are stripped of trailing newlines, so add one here
4719 document_ += '\n';
4720}
4721
4722void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
4723 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