MCPcopy Create free account
hub / github.com/Samsung/ONE / setComment

Method setComment

runtime/3rdparty/jsoncpp/jsoncpp.cpp:4130–4141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4128}
4129
4130void Value::setComment(String comment, CommentPlacement placement)
4131{
4132 if (!comment.empty() && (comment.back() == '\n'))
4133 {
4134 // Always discard trailing newline, to aid indentation.
4135 comment.pop_back();
4136 }
4137 JSON_ASSERT(!comment.empty());
4138 JSON_ASSERT_MESSAGE(comment[0] == '\0' || comment[0] == '/',
4139 "in Json::Value::setComment(): Comments must start with /");
4140 comments_.set(placement, std::move(comment));
4141}
4142
4143bool Value::hasComment(CommentPlacement placement) const { return comments_.has(placement); }
4144

Callers 3

parseMethod · 0.80
readValueMethod · 0.80
addCommentMethod · 0.80

Calls 2

emptyMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected