| 4726 | } |
| 4727 | |
| 4728 | void StyledWriter::writeCommentBeforeValue(const Value& root) { |
| 4729 | if (!root.hasComment(commentBefore)) |
| 4730 | return; |
| 4731 | |
| 4732 | document_ += "\n"; |
| 4733 | writeIndent(); |
| 4734 | const JSONCPP_STRING& comment = root.getComment(commentBefore); |
| 4735 | JSONCPP_STRING::const_iterator iter = comment.begin(); |
| 4736 | while (iter != comment.end()) { |
| 4737 | document_ += *iter; |
| 4738 | if (*iter == '\n' && |
| 4739 | ((iter+1) != comment.end() && *(iter + 1) == '/')) |
| 4740 | writeIndent(); |
| 4741 | ++iter; |
| 4742 | } |
| 4743 | |
| 4744 | // Comments are stripped of trailing newlines, so add one here |
| 4745 | document_ += "\n"; |
| 4746 | } |
| 4747 | |
| 4748 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { |
| 4749 | if (root.hasComment(commentAfterOnSameLine)) |
nothing calls this directly
no test coverage detected