| 241 | } |
| 242 | |
| 243 | void Value::CommentInfo::setComment(const char* text, size_t len) { |
| 244 | if (comment_) { |
| 245 | releaseStringValue(comment_, 0u); |
| 246 | comment_ = nullptr; |
| 247 | } |
| 248 | JSON_ASSERT(text != nullptr); |
| 249 | JSON_ASSERT_MESSAGE( |
| 250 | text[0] == '\0' || text[0] == '/', |
| 251 | "in Json::Value::setComment(): Comments must start with /"); |
| 252 | // It seems that /**/ style comments are acceptable as well. |
| 253 | comment_ = duplicateStringValue(text, len); |
| 254 | } |
| 255 | |
| 256 | // ////////////////////////////////////////////////////////////////// |
| 257 | // ////////////////////////////////////////////////////////////////// |
no test coverage detected