| 3440 | } |
| 3441 | |
| 3442 | void StyledWriter::writeCommentBeforeValue(const Value& root) { |
| 3443 | if (!root.hasComment(commentBefore)) |
| 3444 | return; |
| 3445 | |
| 3446 | document_ += "\n"; |
| 3447 | writeIndent(); |
| 3448 | const std::string& comment = root.getComment(commentBefore); |
| 3449 | std::string::const_iterator iter = comment.begin(); |
| 3450 | while (iter != comment.end()) { |
| 3451 | document_ += *iter; |
| 3452 | if (*iter == '\n' && |
| 3453 | (iter != comment.end() && *(iter + 1) == '/')) |
| 3454 | writeIndent(); |
| 3455 | ++iter; |
| 3456 | } |
| 3457 | |
| 3458 | // Comments are stripped of trailing newlines, so add one here |
| 3459 | document_ += "\n"; |
| 3460 | } |
| 3461 | |
| 3462 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) { |
| 3463 | if (root.hasComment(commentAfterOnSameLine)) |
nothing calls this directly
no test coverage detected