| 130 | |
| 131 | |
| 132 | std::string ellipsizePrefix(const std::string& s, size_t maxCodepoints) { |
| 133 | if (maxCodepoints == 0) |
| 134 | return ""; |
| 135 | std::string s2 = truncatePrefix(s, maxCodepoints); |
| 136 | if (s2 == s) |
| 137 | return s; |
| 138 | // If string was truncated, move forward a codepoint and prepend a Unicode ellipses character |
| 139 | size_t pos = UTF8NextCodepoint(s2, 0); |
| 140 | return "…" + s2.substr(pos); |
| 141 | } |
| 142 | |
| 143 | |
| 144 | bool startsWith(const std::string& str, const std::string& prefix) { |
nothing calls this directly
no test coverage detected