| 4669 | } |
| 4670 | |
| 4671 | void StyledWriter::writeCommentBeforeValue(const Value &root) { |
| 4672 | if (!root.hasComment(commentBefore)) |
| 4673 | return; |
| 4674 | |
| 4675 | document_ += '\n'; |
| 4676 | writeIndent(); |
| 4677 | const String &comment = root.getComment(commentBefore); |
| 4678 | String::const_iterator iter = comment.begin(); |
| 4679 | while (iter != comment.end()) { |
| 4680 | document_ += *iter; |
| 4681 | if (*iter == '\n' && ((iter + 1) != comment.end() && *(iter + 1) == '/')) |
| 4682 | writeIndent(); |
| 4683 | ++iter; |
| 4684 | } |
| 4685 | |
| 4686 | // Comments are stripped of trailing newlines, so add one here |
| 4687 | document_ += '\n'; |
| 4688 | } |
| 4689 | |
| 4690 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value &root) { |
| 4691 | if (root.hasComment(commentAfterOnSameLine)) |
nothing calls this directly
no test coverage detected