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