int MyStringCollateNoCase(const wchar_t *s1, const wchar_t *s2) { while (true) { wchar_t c1 = *s1++; wchar_t c2 = *s2++; wchar_t u1 = MyCharUpper(c1); wchar_t u2 = MyCharUpper(c2); if (u1 < u2) return -1; if (u1 > u2) return 1; if (u1 == 0) return 0; } }
int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2) { for (;;) { wchar_t c1 = *s1++; wchar_t c2 = *s2++; if (c1 != c2) { wchar_t u1 = MyCharUpper(c1); wchar_t u2 = MyCharUpper(c2); if (u1 < u2) return -1; if (u1 > u2) return 1; } if (c1 == 0) return 0; } }
wchar_t * MyStringUpper(wchar_t *s) { if (s == 0) return 0; for (wchar_t *p = s; *p != 0; p++) *p = MyCharUpper(*p); return s; }
wchar_t * MyStringUpper(wchar_t *s) { if (s == 0) return 0; wchar_t *ret = s; while (*s) { *s = MyCharUpper(*s); s++; } return ret; }
static bool EnhancedMaskTest(const UString &mask, int maskPos, const UString &name, int namePos) { int maskLen = mask.Length() - maskPos; int nameLen = name.Length() - namePos; if (maskLen == 0) if (nameLen == 0) return true; else return false; wchar_t maskChar = mask[maskPos]; if(maskChar == kAnyCharChar) { /* if (EnhancedMaskTest(mask, maskPos + 1, name, namePos)) return true; */ if (nameLen == 0) return false; return EnhancedMaskTest(mask, maskPos + 1, name, namePos + 1); } else if(maskChar == kAnyCharsChar) { if (EnhancedMaskTest(mask, maskPos + 1, name, namePos)) return true; if (nameLen == 0) return false; return EnhancedMaskTest(mask, maskPos, name, namePos + 1); } else { wchar_t c = name[namePos]; if (maskChar != c) #ifdef _WIN32 if (MyCharUpper(maskChar) != MyCharUpper(c)) #endif return false; return EnhancedMaskTest(mask, maskPos + 1, name, namePos + 1); } }