MCPcopy Create free account
hub / github.com/Snapchat/Valdi / lowercased

Method lowercased

valdi_core/src/valdi_core/cpp/Utils/StringBox.cpp:330–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330StringBox 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
355StringBox& StringBox::operator+=(const StringBox& other) noexcept {
356 return (*this) = append(other);

Callers 4

getDeviceManufacterFunction · 0.80
getFontForNameMethod · 0.80
toFontKeyFunction · 0.80

Calls 4

getGlobalFunction · 0.85
makeStringMethod · 0.80
lengthFunction · 0.50
reserveMethod · 0.45

Tested by

no test coverage detected