| 2682 | } |
| 2683 | |
| 2684 | void Value::CommentInfo::setComment(const char* text, size_t len) { |
| 2685 | if (comment_) { |
| 2686 | releaseStringValue(comment_, 0u); |
| 2687 | comment_ = 0; |
| 2688 | } |
| 2689 | JSON_ASSERT(text != 0); |
| 2690 | JSON_ASSERT_MESSAGE( |
| 2691 | text[0] == '\0' || text[0] == '/', |
| 2692 | "in Json::Value::setComment(): Comments must start with /"); |
| 2693 | // It seems that /**/ style comments are acceptable as well. |
| 2694 | comment_ = duplicateStringValue(text, len); |
| 2695 | } |
| 2696 | |
| 2697 | // ////////////////////////////////////////////////////////////////// |
| 2698 | // ////////////////////////////////////////////////////////////////// |
no test coverage detected