The below two functions aren't used anymore, not bothering with StringView for them
| 75 | |
| 76 | // The below two functions aren't used anymore, not bothering with StringView for them |
| 77 | String preprocessEscapeCodes(String const& s) { |
| 78 | bool escape = false; |
| 79 | std::string result = s.utf8(); |
| 80 | |
| 81 | size_t escapeStartIdx = 0; |
| 82 | for (size_t i = 0; i < result.size(); i++) { |
| 83 | auto& c = result[i]; |
| 84 | if (isEscapeCode(c)) { |
| 85 | escape = true; |
| 86 | escapeStartIdx = i; |
| 87 | } |
| 88 | if ((c <= SpecialCharLimit) && !(c == StartEsc)) |
| 89 | escape = false; |
| 90 | if ((c == EndEsc) && escape) |
| 91 | result[escapeStartIdx] = StartEsc; |
| 92 | } |
| 93 | return {result}; |
| 94 | } |
| 95 | |
| 96 | String extractCodes(String const& s) { |
| 97 | bool escape = false; |
no test coverage detected