MCPcopy Create free account
hub / github.com/Illumina/hap.py / normalizeEOL

Method normalizeEOL

external/jsoncpp/jsoncpp.cpp:3497–3514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3495}
3496
3497std::string StyledWriter::normalizeEOL(const std::string &text) {
3498 std::string normalized;
3499 normalized.reserve(text.length());
3500 const char *begin = text.c_str();
3501 const char *end = begin + text.length();
3502 const char *current = begin;
3503 while (current != end) {
3504 char c = *current++;
3505 if (c == '\r') // mac or dos EOL
3506 {
3507 if (*current == '\n') // convert dos EOL
3508 ++current;
3509 normalized += '\n';
3510 } else // handle unix EOL & other char
3511 normalized += c;
3512 }
3513 return normalized;
3514}
3515
3516// Class StyledStreamWriter
3517// //////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

c_strMethod · 0.80

Tested by

no test coverage detected