MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / writeCommentBeforeValue

Method writeCommentBeforeValue

src/jsoncpp.cpp:4608–4626  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4606}
4607
4608void StyledWriter::writeCommentBeforeValue(const Value& root) {
4609 if (!root.hasComment(commentBefore))
4610 return;
4611
4612 document_ += "\n";
4613 writeIndent();
4614 const std::string& comment = root.getComment(commentBefore);
4615 std::string::const_iterator iter = comment.begin();
4616 while (iter != comment.end()) {
4617 document_ += *iter;
4618 if (*iter == '\n' &&
4619 (iter != comment.end() && *(iter + 1) == '/'))
4620 writeIndent();
4621 ++iter;
4622 }
4623
4624 // Comments are stripped of trailing newlines, so add one here
4625 document_ += "\n";
4626}
4627
4628void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
4629 if (root.hasComment(commentAfterOnSameLine))

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected