| 14 | using std::wstring; |
| 15 | |
| 16 | bool endswith(const char* str, const char* ending) { |
| 17 | size_t str_len = strlen(str); |
| 18 | size_t end_len = strlen(ending); |
| 19 | |
| 20 | if (str_len >= end_len) { |
| 21 | for (unsigned i = 0; i < end_len; i++) { |
| 22 | int str_len_index = i + str_len - end_len; |
| 23 | if (str[str_len_index] != ending[i]) { |
| 24 | return false; |
| 25 | } |
| 26 | } |
| 27 | return true; |
| 28 | } else { |
| 29 | return false; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | bool beginswith(const char* str, const char* begin) { |
| 34 | size_t str_len = strlen(str); |