| 2700 | } |
| 2701 | |
| 2702 | void Value::CommentInfo::setComment(const char* text, size_t len) { |
| 2703 | if (comment_) { |
| 2704 | releaseStringValue(comment_, 0u); |
| 2705 | comment_ = 0; |
| 2706 | } |
| 2707 | JSON_ASSERT(text != 0); |
| 2708 | JSON_ASSERT_MESSAGE( |
| 2709 | text[0] == '\0' || text[0] == '/', |
| 2710 | "in Json::Value::setComment(): Comments must start with /"); |
| 2711 | // It seems that /**/ style comments are acceptable as well. |
| 2712 | comment_ = duplicateStringValue(text, len); |
| 2713 | } |
| 2714 | |
| 2715 | // ////////////////////////////////////////////////////////////////// |
| 2716 | // ////////////////////////////////////////////////////////////////// |
no test coverage detected