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