sucl
This commit is contained in:
parent
8709ef9de9
commit
ef6c4d3326
1 changed files with 5 additions and 8 deletions
|
@ -20,12 +20,9 @@ using util::error::DracError, util::error::DracErrorCode;
|
||||||
using util::helpers::GetEnv;
|
using util::helpers::GetEnv;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
fn StrEqualsIgnoreCase(std::string_view strA, std::string_view strB) -> bool {
|
fn StrEqualsIgnoreCase(StringView strA, StringView strB) -> bool {
|
||||||
if (strA.length() != strB.length())
|
return std::ranges::equal(strA, strB, [](char aChar, char bChar) {
|
||||||
return false;
|
return std::tolower(static_cast<u8>(aChar)) == std::tolower(static_cast<u8>(bChar));
|
||||||
|
|
||||||
return std::equal(strA.begin(), strA.end(), strB.begin(), [](char aChar, char bChar) {
|
|
||||||
return std::tolower(static_cast<unsigned char>(aChar)) == std::tolower(static_cast<unsigned char>(bChar));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +31,7 @@ namespace {
|
||||||
return None;
|
return None;
|
||||||
|
|
||||||
String result(sview);
|
String result(sview);
|
||||||
result[0] = static_cast<char>(std::toupper(static_cast<unsigned char>(result[0])));
|
result.front() = static_cast<char>(std::toupper(static_cast<u8>(result.front())));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +55,7 @@ namespace os {
|
||||||
fn GetDesktopEnvironment() -> Result<String> { return "Aqua"; }
|
fn GetDesktopEnvironment() -> Result<String> { return "Aqua"; }
|
||||||
|
|
||||||
fn GetWindowManager() -> Result<String> {
|
fn GetWindowManager() -> Result<String> {
|
||||||
constexpr std::array<std::string_view, 6> knownWms = {
|
constexpr Array<StringView, 6> knownWms = {
|
||||||
"yabai", "kwm", "chunkwm", "amethyst", "spectacle", "rectangle",
|
"yabai", "kwm", "chunkwm", "amethyst", "spectacle", "rectangle",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue