| 582 | } |
| 583 | |
| 584 | void StyledWriter::writeCommentBeforeValue(const Value& root) { |
| 585 | if (!root.hasComment(commentBefore)) |
| 586 | return; |
| 587 | |
| 588 | document_ += "\n"; |
| 589 | writeIndent(); |
| 590 | const JSONCPP_STRING& comment = root.getComment(commentBefore); |
| 591 | JSONCPP_STRING::const_iterator iter = comment.begin(); |
| 592 | while (iter != comment.end()) { |
| 593 | document_ += *iter; |
| 594 | if (*iter == '\n' && |
| 595 | ((iter+1) != comment.end() && *(iter + 1) == '/')) |
| 596 | writeIndent(); |
| 597 | ++iter; |
| 598 | } |
| 599 | |
| 600 | // Comments are stripped of trailing newlines, so add one here |
| 601 | document_ += "\n"; |
| 602 | } |
| 603 | |
| 604 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { |
| 605 | if (root.hasComment(commentAfterOnSameLine)) |
nothing calls this directly
no test coverage detected