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

Method writeCommentBeforeValue

vrclient_x64/jsoncpp.cpp:4607–4625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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