MCPcopy Create free account
hub / github.com/Kitware/VTK / setComment

Method setComment

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:3849–3858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3847}
3848
3849void Value::setComment(String comment, CommentPlacement placement) {
3850 if (!comment.empty() && (comment.back() == '\n')) {
3851 // Always discard trailing newline, to aid indentation.
3852 comment.pop_back();
3853 }
3854 JSON_ASSERT_MESSAGE(
3855 comment.empty() || comment[0] == '/',
3856 "in Json::Value::setComment(): Comments must start with /");
3857 comments_.set(placement, std::move(comment));
3858}
3859
3860bool Value::hasComment(CommentPlacement placement) const {
3861 return comments_.has(placement);

Callers 3

parseMethod · 0.80
readValueMethod · 0.80
addCommentMethod · 0.80

Calls 4

backMethod · 0.80
pop_backMethod · 0.80
emptyMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected