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

Function normalizeEOL

vrclient_x64/jsoncpp.cpp:555–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

addCommentMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected