add func to path manager. fix bitmap handler. add general bitmap handler getter

This commit is contained in:
2023-09-07 21:57:48 +08:00
parent f7f1478ecf
commit 54a3dd7776
11 changed files with 264 additions and 66 deletions

View File

@ -78,6 +78,32 @@ namespace LibCmo::CK2 {
}
}
bool CKStrEqualI(CKSTRING str1, CKSTRING str2) {
if (str1 == nullptr) {
if (str2 == nullptr) return true;
else return false;
} else {
if (str2 == nullptr) return false;
else {
// do real cmp
size_t i = 0;
while (str1[i] != '\0' && str2[i] != '\0') {
if (std::tolower(str1[i]) != std::tolower(str2[i])) return false;
++str1;
++str2;
}
// !XOR the result, if both of them is zero, return true(1)
return !((str1[i] != '\0') ^ (str2[i] != '\0'));
}
}
}
bool CKStrEmpty(CKSTRING strl) {
if (strl == nullptr) return true;
return strl[0] == '\0';
}
#pragma endregion
#pragma region CKClass Registration