MCPcopy Create free account
hub / github.com/cinder/Cinder / writeCommentBeforeValue

Method writeCommentBeforeValue

src/jsoncpp/jsoncpp.cpp:3442–3460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3440}
3441
3442void StyledWriter::writeCommentBeforeValue(const Value& root) {
3443 if (!root.hasComment(commentBefore))
3444 return;
3445
3446 document_ += "\n";
3447 writeIndent();
3448 const std::string& comment = root.getComment(commentBefore);
3449 std::string::const_iterator iter = comment.begin();
3450 while (iter != comment.end()) {
3451 document_ += *iter;
3452 if (*iter == '\n' &&
3453 (iter != comment.end() && *(iter + 1) == '/'))
3454 writeIndent();
3455 ++iter;
3456 }
3457
3458 // Comments are stripped of trailing newlines, so add one here
3459 document_ += "\n";
3460}
3461
3462void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
3463 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