MCPcopy Create free account
hub / github.com/SOUI2/soui / writeCommentBeforeValue

Method writeCommentBeforeValue

third-part/jsoncpp/src/lib_json/json_writer.cpp:584–602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

582}
583
584void StyledWriter::writeCommentBeforeValue(const Value& root) {
585 if (!root.hasComment(commentBefore))
586 return;
587
588 document_ += "\n";
589 writeIndent();
590 const JSONCPP_STRING& comment = root.getComment(commentBefore);
591 JSONCPP_STRING::const_iterator iter = comment.begin();
592 while (iter != comment.end()) {
593 document_ += *iter;
594 if (*iter == '\n' &&
595 ((iter+1) != comment.end() && *(iter + 1) == '/'))
596 writeIndent();
597 ++iter;
598 }
599
600 // Comments are stripped of trailing newlines, so add one here
601 document_ += "\n";
602}
603
604void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
605 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