| 4701 | } |
| 4702 | |
| 4703 | void StyledWriter::writeCommentBeforeValue(const Value& root) { |
| 4704 | if (!root.hasComment(commentBefore)) |
| 4705 | return; |
| 4706 | |
| 4707 | document_ += '\n'; |
| 4708 | writeIndent(); |
| 4709 | const String& comment = root.getComment(commentBefore); |
| 4710 | String::const_iterator iter = comment.begin(); |
| 4711 | while (iter != comment.end()) { |
| 4712 | document_ += *iter; |
| 4713 | if (*iter == '\n' && ((iter + 1) != comment.end() && *(iter + 1) == '/')) |
| 4714 | writeIndent(); |
| 4715 | ++iter; |
| 4716 | } |
| 4717 | |
| 4718 | // Comments are stripped of trailing newlines, so add one here |
| 4719 | document_ += '\n'; |
| 4720 | } |
| 4721 | |
| 4722 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { |
| 4723 | if (root.hasComment(commentAfterOnSameLine)) |
nothing calls this directly
no test coverage detected