8 // Like boost, but ASCII only. Only C locale required.
10 inline bool iequal_char(char a
, char b
)
12 return std::toupper(static_cast<unsigned char>(a
)) ==
13 std::toupper(static_cast<unsigned char>(b
));
16 inline bool iequal(std::string_view a
, std::string_view b
)
18 return (size(a
) == size(b
)) &&
19 std::equal(begin(b
), end(b
), begin(a
), iequal_char
);
22 inline bool iless_char(char a
, char b
)
24 return std::toupper(static_cast<unsigned char>(a
)) <
25 std::toupper(static_cast<unsigned char>(b
));
28 inline bool iless(std::string_view a
, std::string_view b
)
30 return std::lexicographical_compare(begin(a
), end(a
), begin(b
), end(b
),
34 inline bool istarts_with(std::string_view str
, std::string_view prefix
)
36 return (str
.size() >= prefix
.size()) &&
37 iequal(str
.substr(0, prefix
.size()), prefix
);
41 bool operator()(std::string_view a
, std::string_view b
) const
47 // Ahh, the olden days of loops and pointers...
49 // inline bool iequal(char const* a, char const* b)
54 // if (!iequal_char(*a, *b))
63 #endif // IEQUAL_DOT_HPP