| 4606 | } |
| 4607 | |
| 4608 | void StyledWriter::writeCommentBeforeValue(const Value& root) { |
| 4609 | if (!root.hasComment(commentBefore)) |
| 4610 | return; |
| 4611 | |
| 4612 | document_ += "\n"; |
| 4613 | writeIndent(); |
| 4614 | const std::string& comment = root.getComment(commentBefore); |
| 4615 | std::string::const_iterator iter = comment.begin(); |
| 4616 | while (iter != comment.end()) { |
| 4617 | document_ += *iter; |
| 4618 | if (*iter == '\n' && |
| 4619 | (iter != comment.end() && *(iter + 1) == '/')) |
| 4620 | writeIndent(); |
| 4621 | ++iter; |
| 4622 | } |
| 4623 | |
| 4624 | // Comments are stripped of trailing newlines, so add one here |
| 4625 | document_ += "\n"; |
| 4626 | } |
| 4627 | |
| 4628 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { |
| 4629 | if (root.hasComment(commentAfterOnSameLine)) |
nothing calls this directly
no test coverage detected