| 4651 | } |
| 4652 | |
| 4653 | void StyledWriter::writeCommentBeforeValue(const Value& root) { |
| 4654 | if (!root.hasComment(commentBefore)) |
| 4655 | return; |
| 4656 | |
| 4657 | document_ += "\n"; |
| 4658 | writeIndent(); |
| 4659 | const JSONCPP_STRING& comment = root.getComment(commentBefore); |
| 4660 | JSONCPP_STRING::const_iterator iter = comment.begin(); |
| 4661 | while (iter != comment.end()) { |
| 4662 | document_ += *iter; |
| 4663 | if (*iter == '\n' && |
| 4664 | (iter != comment.end() && *(iter + 1) == '/')) |
| 4665 | writeIndent(); |
| 4666 | ++iter; |
| 4667 | } |
| 4668 | |
| 4669 | // Comments are stripped of trailing newlines, so add one here |
| 4670 | document_ += "\n"; |
| 4671 | } |
| 4672 | |
| 4673 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { |
| 4674 | if (root.hasComment(commentAfterOnSameLine)) |
nothing calls this directly
no test coverage detected