| 328 | } |
| 329 | |
| 330 | StringBox StringBox::lowercased() const noexcept { |
| 331 | auto hasUppercase = false; |
| 332 | |
| 333 | auto strView = toStringView(); |
| 334 | for (auto c : strView) { |
| 335 | if (std::isupper(c) != 0) { |
| 336 | hasUppercase = true; |
| 337 | break; |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | if (!hasUppercase) { |
| 342 | return *this; |
| 343 | } |
| 344 | |
| 345 | std::string out; |
| 346 | out.reserve(length()); |
| 347 | |
| 348 | for (auto c : strView) { |
| 349 | out.push_back(std::tolower(c)); |
| 350 | } |
| 351 | |
| 352 | return StringCache::getGlobal().makeString(std::move(out)); |
| 353 | } |
| 354 | |
| 355 | StringBox& StringBox::operator+=(const StringBox& other) noexcept { |
| 356 | return (*this) = append(other); |
no test coverage detected