| 1618 | } |
| 1619 | |
| 1620 | void Value::setComment(StringContainer comment, CommentPlacement placement) { |
| 1621 | if (!comment.empty() && (comment.back() == '\n')) { |
| 1622 | // Always discard trailing newline, to aid indentation. |
| 1623 | //comment.pop_back(); |
| 1624 | } |
| 1625 | // TODO |
| 1626 | /*JSON_ASSERT_MESSAGE( |
| 1627 | comment.empty() || comment[0] == '/', |
| 1628 | "in Json::Value::setComment(): Comments must start with /");*/ |
| 1629 | comments_.set(placement, std::move(comment)); |
| 1630 | } |
| 1631 | |
| 1632 | bool Value::hasComment() const { |
| 1633 | return comments_.hasAny(); |