MCPcopy Create free account
hub / github.com/Samsung/ONE / writeCommentBeforeValue

Method writeCommentBeforeValue

runtime/3rdparty/jsoncpp/jsoncpp.cpp:5076–5095  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5074}
5075
5076void StyledWriter::writeCommentBeforeValue(const Value &root)
5077{
5078 if (!root.hasComment(commentBefore))
5079 return;
5080
5081 document_ += '\n';
5082 writeIndent();
5083 const String &comment = root.getComment(commentBefore);
5084 String::const_iterator iter = comment.begin();
5085 while (iter != comment.end())
5086 {
5087 document_ += *iter;
5088 if (*iter == '\n' && ((iter + 1) != comment.end() && *(iter + 1) == '/'))
5089 writeIndent();
5090 ++iter;
5091 }
5092
5093 // Comments are stripped of trailing newlines, so add one here
5094 document_ += '\n';
5095}
5096
5097void StyledWriter::writeCommentAfterValueOnSameLine(const Value &root)
5098{

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