| 231 | } |
| 232 | |
| 233 | void Value::CommentInfo::setComment(const char* text, size_t len) { |
| 234 | if (comment_) { |
| 235 | releaseStringValue(comment_, 0u); |
| 236 | comment_ = 0; |
| 237 | } |
| 238 | JSON_ASSERT(text != 0); |
| 239 | JSON_ASSERT_MESSAGE( |
| 240 | text[0] == '\0' || text[0] == '/', |
| 241 | "in Json::Value::setComment(): Comments must start with /"); |
| 242 | // It seems that /**/ style comments are acceptable as well. |
| 243 | comment_ = duplicateStringValue(text, len); |
| 244 | } |
| 245 | |
| 246 | // ////////////////////////////////////////////////////////////////// |
| 247 | // ////////////////////////////////////////////////////////////////// |
no test coverage detected