| 4777 | } |
| 4778 | |
| 4779 | void StyledWriter::writeCommentBeforeValue(const Value& root) { |
| 4780 | if (!root.hasComment(commentBefore)) |
| 4781 | return; |
| 4782 | |
| 4783 | document_ += '\n'; |
| 4784 | writeIndent(); |
| 4785 | const JSONCPP_STRING& comment = root.getComment(commentBefore); |
| 4786 | JSONCPP_STRING::const_iterator iter = comment.begin(); |
| 4787 | while (iter != comment.end()) { |
| 4788 | document_ += *iter; |
| 4789 | if (*iter == '\n' && ((iter + 1) != comment.end() && *(iter + 1) == '/')) |
| 4790 | writeIndent(); |
| 4791 | ++iter; |
| 4792 | } |
| 4793 | |
| 4794 | // Comments are stripped of trailing newlines, so add one here |
| 4795 | document_ += '\n'; |
| 4796 | } |
| 4797 | |
| 4798 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { |
| 4799 | if (root.hasComment(commentAfterOnSameLine)) |
nothing calls this directly
no test coverage detected