MCPcopy Index your code
hub / github.com/Kitware/CMake / setComment

Method setComment

Utilities/cmjsoncpp/src/lib_json/json_value.cpp:1411–1420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1409}
1410
1411void Value::setComment(String comment, CommentPlacement placement) {
1412 if (!comment.empty() && (comment.back() == '\n')) {
1413 // Always discard trailing newline, to aid indentation.
1414 comment.pop_back();
1415 }
1416 JSON_ASSERT_MESSAGE(
1417 comment.empty() || comment[0] == '/',
1418 "in Json::Value::setComment(): Comments must start with /");
1419 comments_.set(placement, std::move(comment));
1420}
1421
1422bool Value::hasComment(CommentPlacement placement) const {
1423 return comments_.has(placement);

Callers 3

parseMethod · 0.80
readValueMethod · 0.80
addCommentMethod · 0.80

Calls 5

moveFunction · 0.85
pop_backMethod · 0.80
setMethod · 0.80
emptyMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected