mirror of
https://github.com/sebastiandine/Card-Collection-Manager-3.git
synced 2026-08-29 09:18:48 +00:00
23 lines
558 B
C++
23 lines
558 B
C++
#pragma once
|
|
|
|
#include <cctype>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
namespace ccm {
|
|
|
|
// ASCII-only tolower for sort/filter parity with the legacy TS path:
|
|
// String.prototype.toLowerCase() on English/German/etc. card metadata behaves
|
|
// identically for this byte range.
|
|
[[nodiscard]] inline std::string asciiLower(std::string_view s) {
|
|
std::string out;
|
|
out.reserve(s.size());
|
|
for (char c : s) {
|
|
out.push_back(static_cast<char>(
|
|
std::tolower(static_cast<unsigned char>(c))));
|
|
}
|
|
return out;
|
|
}
|
|
|
|
} // namespace ccm
|