| 2356 | } |
| 2357 | |
| 2358 | void Value::CommentInfo::setComment(const char* text, size_t len) { |
| 2359 | if (comment_) { |
| 2360 | releaseStringValue(comment_); |
| 2361 | comment_ = 0; |
| 2362 | } |
| 2363 | JSON_ASSERT(text != 0); |
| 2364 | JSON_ASSERT_MESSAGE( |
| 2365 | text[0] == '\0' || text[0] == '/', |
| 2366 | "in Json::Value::setComment(): Comments must start with /"); |
| 2367 | // It seems that /**/ style comments are acceptable as well. |
| 2368 | comment_ = duplicateStringValue(text, len); |
| 2369 | } |
| 2370 | |
| 2371 | // ////////////////////////////////////////////////////////////////// |
| 2372 | // ////////////////////////////////////////////////////////////////// |
no test coverage detected