| 586 | } |
| 587 | |
| 588 | void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) { |
| 589 | if (cs_ == CommentStyle::None) |
| 590 | return; |
| 591 | if (!root.hasComment(commentBefore)) |
| 592 | return; |
| 593 | |
| 594 | if (!indented_) |
| 595 | writeIndent(); |
| 596 | const StringContainer& comment = root.getComment(commentBefore); |
| 597 | if (comment != "\n") { |
| 598 | StringContainer::const_iterator iter = comment.begin(); |
| 599 | while (iter != comment.end()) { |
| 600 | *sout_ << *iter; |
| 601 | if (*iter == '\n' && ((iter + 1) != comment.end() && *(iter + 1) == '/')) |
| 602 | // writeIndent(); // would write extra newline |
| 603 | *sout_ << indentString_; |
| 604 | ++iter; |
| 605 | } |
| 606 | } |
| 607 | indented_ = false; |
| 608 | } |
| 609 | |
| 610 | void BuiltStyledStreamWriter::writeCommentAfterValueOnSameLine(Value const& root) { |
| 611 | if (cs_ == CommentStyle::None) |
nothing calls this directly
no test coverage detected