| 3459 | } |
| 3460 | |
| 3461 | void StyledWriter::writeCommentBeforeValue(const Value &root) { |
| 3462 | if (!root.hasComment(commentBefore)) |
| 3463 | return; |
| 3464 | |
| 3465 | document_ += "\n"; |
| 3466 | writeIndent(); |
| 3467 | std::string normalizedComment = normalizeEOL(root.getComment(commentBefore)); |
| 3468 | std::string::const_iterator iter = normalizedComment.begin(); |
| 3469 | while (iter != normalizedComment.end()) { |
| 3470 | document_ += *iter; |
| 3471 | if (*iter == '\n' && *(iter + 1) == '/') |
| 3472 | writeIndent(); |
| 3473 | ++iter; |
| 3474 | } |
| 3475 | |
| 3476 | // Comments are stripped of newlines, so add one here |
| 3477 | document_ += "\n"; |
| 3478 | } |
| 3479 | |
| 3480 | void StyledWriter::writeCommentAfterValueOnSameLine(const Value &root) { |
| 3481 | if (root.hasComment(commentAfterOnSameLine)) |
nothing calls this directly
no test coverage detected