MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / normalizeEOL

Function normalizeEOL

src/jsoncpp.cpp:556–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

554}
555
556static std::string normalizeEOL(Reader::Location begin, Reader::Location end) {
557 std::string normalized;
558 normalized.reserve(end - begin);
559 Reader::Location current = begin;
560 while (current != end) {
561 char c = *current++;
562 if (c == '\r') {
563 if (current != end && *current == '\n')
564 // convert dos EOL
565 ++current;
566 // convert Mac EOL
567 normalized += '\n';
568 } else {
569 normalized += c;
570 }
571 }
572 return normalized;
573}
574
575void
576Reader::addComment(Location begin, Location end, CommentPlacement placement) {

Callers 1

addCommentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected