| 584 | } |
| 585 | |
| 586 | JSONCPP_STRING Reader::normalizeEOL(Reader::Location begin, Reader::Location end) { |
| 587 | JSONCPP_STRING normalized; |
| 588 | normalized.reserve(static_cast<size_t>(end - begin)); |
| 589 | Reader::Location current = begin; |
| 590 | while (current != end) { |
| 591 | char c = *current++; |
| 592 | if (c == '\r') { |
| 593 | if (current != end && *current == '\n') |
| 594 | // convert dos EOL |
| 595 | ++current; |
| 596 | // convert Mac EOL |
| 597 | normalized += '\n'; |
| 598 | } else { |
| 599 | normalized += c; |
| 600 | } |
| 601 | } |
| 602 | return normalized; |
| 603 | } |
| 604 | |
| 605 | void |
| 606 | Reader::addComment(Location begin, Location end, CommentPlacement placement) { |
nothing calls this directly
no outgoing calls
no test coverage detected