MCPcopy Create free account
hub / github.com/Illumina/hap.py / writeCommentBeforeValue

Method writeCommentBeforeValue

external/jsoncpp/jsoncpp.cpp:3461–3478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3459}
3460
3461void StyledWriter::writeCommentBeforeValue(const Value &root) {
3462 if (!root.hasComment(commentBefore))
3463 return;
3464
3465 document_ += "\n";
3466 writeIndent();
3467 std::string normalizedComment = normalizeEOL(root.getComment(commentBefore));
3468 std::string::const_iterator iter = normalizedComment.begin();
3469 while (iter != normalizedComment.end()) {
3470 document_ += *iter;
3471 if (*iter == '\n' && *(iter + 1) == '/')
3472 writeIndent();
3473 ++iter;
3474 }
3475
3476 // Comments are stripped of newlines, so add one here
3477 document_ += "\n";
3478}
3479
3480void StyledWriter::writeCommentAfterValueOnSameLine(const Value &root) {
3481 if (root.hasComment(commentAfterOnSameLine))

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected