| 5074 | } |
| 5075 | |
| 5076 | void StyledWriter::writeCommentBeforeValue(const Value &root) |
| 5077 | { |
| 5078 | if (!root.hasComment(commentBefore)) |
| 5079 | return; |
| 5080 | |
| 5081 | document_ += '\n'; |
| 5082 | writeIndent(); |
| 5083 | const String &comment = root.getComment(commentBefore); |
| 5084 | String::const_iterator iter = comment.begin(); |
| 5085 | while (iter != comment.end()) |
| 5086 | { |
| 5087 | document_ += *iter; |
| 5088 | if (*iter == '\n' && ((iter + 1) != comment.end() && *(iter + 1) == '/')) |
| 5089 | writeIndent(); |
| 5090 | ++iter; |
| 5091 | } |
| 5092 | |
| 5093 | // Comments are stripped of trailing newlines, so add one here |
| 5094 | document_ += '\n'; |
| 5095 | } |
| 5096 | |
| 5097 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value &root) |
| 5098 | { |
nothing calls this directly
no test coverage detected