| 613 | } |
| 614 | |
| 615 | void StyledWriter::writeCommentBeforeValue(const Value& root) { |
| 616 | if (!root.hasComment(commentBefore)) |
| 617 | return; |
| 618 | |
| 619 | document_ += '\n'; |
| 620 | writeIndent(); |
| 621 | const String& comment = root.getComment(commentBefore); |
| 622 | String::const_iterator iter = comment.begin(); |
| 623 | while (iter != comment.end()) { |
| 624 | document_ += *iter; |
| 625 | if (*iter == '\n' && ((iter + 1) != comment.end() && *(iter + 1) == '/')) |
| 626 | writeIndent(); |
| 627 | ++iter; |
| 628 | } |
| 629 | |
| 630 | // Comments are stripped of trailing newlines, so add one here |
| 631 | document_ += '\n'; |
| 632 | } |
| 633 | |
| 634 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { |
| 635 | if (root.hasComment(commentAfterOnSameLine)) |
nothing calls this directly
no test coverage detected