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

Method setComment

external/jsoncpp/jsoncpp.cpp:3838–3848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3836}
3837
3838void Value::setComment(String comment, CommentPlacement placement) {
3839 if (!comment.empty() && (comment.back() == '\n')) {
3840 // Always discard trailing newline, to aid indentation.
3841 comment.pop_back();
3842 }
3843 JSON_ASSERT(!comment.empty());
3844 JSON_ASSERT_MESSAGE(
3845 comment[0] == '\0' || comment[0] == '/',
3846 "in Json::Value::setComment(): Comments must start with /");
3847 comments_.set(placement, std::move(comment));
3848}
3849
3850bool Value::hasComment(CommentPlacement placement) const {
3851 return comments_.has(placement);

Callers 3

parseMethod · 0.80
readValueMethod · 0.80
addCommentMethod · 0.80

Calls 2

emptyMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected