| 299 | } |
| 300 | |
| 301 | bool String::operator==(const char *p_str) const { |
| 302 | // compare Latin-1 encoded c-string |
| 303 | int len = strlen(p_str); |
| 304 | |
| 305 | if (length() != len) { |
| 306 | return false; |
| 307 | } |
| 308 | if (is_empty()) { |
| 309 | return true; |
| 310 | } |
| 311 | |
| 312 | int l = length(); |
| 313 | |
| 314 | const char32_t *dst = get_data(); |
| 315 | |
| 316 | // Compare char by char |
| 317 | for (int i = 0; i < l; i++) { |
| 318 | if ((char32_t)p_str[i] != dst[i]) { |
| 319 | return false; |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | return true; |
| 324 | } |
| 325 | |
| 326 | bool String::operator==(const wchar_t *p_str) const { |
| 327 | #ifdef WINDOWS_ENABLED |