* @brief Checks if str1 == str2 (case-insensitively). */
| 281 | * @brief Checks if <tt>str1 == str2</tt> (case-insensitively). |
| 282 | */ |
| 283 | bool areEqualCaseInsensitive(const std::string &str1, const std::string &str2) { |
| 284 | if (str1.size() != str2.size()) { |
| 285 | return false; |
| 286 | } |
| 287 | |
| 288 | for (std::string::size_type i = 0, e = str1.size(); i < e; ++i) { |
| 289 | const unsigned char lc = str1[i]; |
| 290 | const unsigned char rc = str2[i]; |
| 291 | if (std::tolower(lc) != std::tolower(rc)) { |
| 292 | return false; |
| 293 | } |
| 294 | } |
| 295 | return true; |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * @brief Checks if the shorter string of @a str1 and @a str2 is a |