| 120 | } |
| 121 | |
| 122 | string padded_str(const string &s, int pad_to, bool prepend) |
| 123 | { |
| 124 | const int padding = pad_to - codepoints(s); |
| 125 | if (padding <= 0) |
| 126 | return s; |
| 127 | string str = s; |
| 128 | if (prepend) |
| 129 | str.insert(0, string(padding, ' ')); |
| 130 | else |
| 131 | str.append(padding, ' '); |
| 132 | return str; |
| 133 | } |
| 134 | |
| 135 | int ends_with(const string &s, const char * const suffixes[]) |
| 136 | { |
no test coverage detected