MCPcopy Create free account
hub / github.com/cuberite/cuberite / normalizeEOL

Method normalizeEOL

lib/jsoncpp/src/lib_json/json_writer.cpp:517–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515
516
517std::string
518StyledWriter::normalizeEOL( const std::string &text )
519{
520 std::string normalized;
521 normalized.reserve( text.length() );
522 const char *begin = text.c_str();
523 const char *end = begin + text.length();
524 const char *current = begin;
525 while ( current != end )
526 {
527 char c = *current++;
528 if ( c == '\r' ) // mac or dos EOL
529 {
530 if ( *current == '\n' ) // convert dos EOL
531 ++current;
532 normalized += '\n';
533 }
534 else // handle unix EOL & other char
535 normalized += c;
536 }
537 return normalized;
538}
539
540
541// Class StyledStreamWriter

Callers

nothing calls this directly

Calls 1

c_strMethod · 0.80

Tested by

no test coverage detected