21 public std::char_traits<char>
23 static bool eq(
char ch1,
char ch2)
25 MIKTEX_ASSERT(
static_cast<unsigned>(ch1) < 128 &&
static_cast<unsigned>(ch2) < 128);
26 return tolower(ch1) == tolower(ch2);
29 static bool lt(
char ch1,
char ch2)
31 MIKTEX_ASSERT(
static_cast<unsigned>(ch1) < 128 &&
static_cast<unsigned>(ch2) < 128);
32 return tolower(ch1) < tolower(ch2);
35 static int compare(
const char* s1,
const char* s2,
size_t n)
37 return MiKTeX::Util::CeeStringCompare(s1, s2, n,
true);
40 static const char* find(
const char* s,
int n,
const char& ch)
42 while (n-- > 0 && tolower(*s) != tolower(ch))
56 template <>
struct hash<MiKTeX::Core::ci_string>
58 size_t operator()(
const MiKTeX::Core::ci_string& str)
const
61#if defined(_M_AMD64) || defined(_M_X64) || defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(__arch64__)
62 MIKTEX_ASSERT(
sizeof(
size_t) == 8);
63 const size_t FNV_prime = 1099511628211ULL;
64 const size_t offset_basis = 14695981039346656037ULL;
66 MIKTEX_ASSERT(
sizeof(
size_t) == 4);
67 const size_t FNV_prime = 16777619;
68 const size_t offset_basis = 2166136261;
70 size_t hash = offset_basis;
71 for (MiKTeX::Core::ci_string::const_iterator it = str.begin(); it != str.end(); ++it)
74 MIKTEX_ASSERT(
static_cast<unsigned>(ch) < 128);