| 2629 | } |
| 2630 | |
| 2631 | void Value::CommentInfo::setComment(const char* text, size_t len) { |
| 2632 | if (comment_) { |
| 2633 | releaseStringValue(comment_); |
| 2634 | comment_ = 0; |
| 2635 | } |
| 2636 | JSON_ASSERT(text != 0); |
| 2637 | JSON_ASSERT_MESSAGE( |
| 2638 | text[0] == '\0' || text[0] == '/', |
| 2639 | "in Json::Value::setComment(): Comments must start with /"); |
| 2640 | // It seems that /**/ style comments are acceptable as well. |
| 2641 | comment_ = duplicateStringValue(text, len); |
| 2642 | } |
| 2643 | |
| 2644 | // ////////////////////////////////////////////////////////////////// |
| 2645 | // ////////////////////////////////////////////////////////////////// |
no test coverage detected