|
|
|
@ -107,8 +107,11 @@ void ToUpper(std::wstring & s);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class StringType1, class StringType2>
|
|
|
|
|
bool EqualNoCase(const StringType1 * str1, const StringType2 * str2)
|
|
|
|
|
int CompareNoCase(const StringType1 * str1, const StringType2 * str2)
|
|
|
|
|
{
|
|
|
|
|
while( *str1 && *str2 && ToLower(*str1) == ToLower(*str2) )
|
|
|
|
|
{
|
|
|
|
@ -117,73 +120,84 @@ bool EqualNoCase(const StringType1 * str1, const StringType2 * str2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( *str1 == 0 && *str2 == 0 )
|
|
|
|
|
return true;
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
return (int)ToLower(*str1) - (int)ToLower(*str2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class StringType1, class StringType2>
|
|
|
|
|
bool EqualNoCase(const StringType1 & str1, const StringType2 & str2)
|
|
|
|
|
int CompareNoCase(const StringType1 & str1, const StringType2 & str2)
|
|
|
|
|
{
|
|
|
|
|
return EqualNoCase(str1.c_str(), str2.c_str());
|
|
|
|
|
return CompareNoCase(str1.c_str(), str2.c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class StringType1, class StringType2>
|
|
|
|
|
bool EqualNoCasep(const StringType1 * str1, const StringType2 * str2)
|
|
|
|
|
int CompareNoCasep(const StringType1 * str1, const StringType2 * str2)
|
|
|
|
|
{
|
|
|
|
|
return EqualNoCase(str1, str2);
|
|
|
|
|
return CompareNoCase(str1, str2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class StringType1, class StringType2>
|
|
|
|
|
int CompareNoCase(const StringType1 * str1, const StringType2 * str2)
|
|
|
|
|
int CompareNoCase(const StringType1 * str1_begin, const StringType1 * str1_end, const StringType2 * str2)
|
|
|
|
|
{
|
|
|
|
|
while( *str1 && *str2 && ToLower(*str1) == ToLower(*str2) )
|
|
|
|
|
while( str1_begin < str1_end && *str2 && ToLower(*str1_begin) == ToLower(*str2) )
|
|
|
|
|
{
|
|
|
|
|
++str1;
|
|
|
|
|
++str1_begin;
|
|
|
|
|
++str2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( *str1 == 0 && *str2 == 0 )
|
|
|
|
|
if( str1_begin == str1_end && *str2 == 0 )
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return (int)ToLower(*str1) - (int)ToLower(*str2);
|
|
|
|
|
wchar_t str1_char = 0;
|
|
|
|
|
|
|
|
|
|
if( str1_begin < str1_end )
|
|
|
|
|
str1_char = *str1_begin;
|
|
|
|
|
|
|
|
|
|
return (int)ToLower(str1_char) - (int)ToLower(*str2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class StringType1, class StringType2>
|
|
|
|
|
int CompareNoCase(const StringType1 & str1, const StringType2 & str2)
|
|
|
|
|
bool EqualNoCase(const StringType1 * str1, const StringType2 * str2)
|
|
|
|
|
{
|
|
|
|
|
return CompareNoCase(str1.c_str(), str2.c_str());
|
|
|
|
|
return CompareNoCase(str1, str2) == 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class StringType1, class StringType2>
|
|
|
|
|
int CompareNoCasep(const StringType1 * str1, const StringType2 * str2)
|
|
|
|
|
bool EqualNoCase(const StringType1 & str1, const StringType2 & str2)
|
|
|
|
|
{
|
|
|
|
|
return CompareNoCase(str1, str2);
|
|
|
|
|
return EqualNoCase(str1.c_str(), str2.c_str());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<class StringType1, class StringType2>
|
|
|
|
|
bool EqualNoCase(const StringType1 * str1_begin, const StringType1 * str1_end, const StringType2 * str2)
|
|
|
|
|
bool EqualNoCasep(const StringType1 * str1, const StringType2 * str2)
|
|
|
|
|
{
|
|
|
|
|
while( str1_begin < str1_end && *str2 && PT::ToLower(*str1_begin) == PT::ToLower(*str2) )
|
|
|
|
|
{
|
|
|
|
|
++str1_begin;
|
|
|
|
|
++str2;
|
|
|
|
|
}
|
|
|
|
|
return EqualNoCase(str1, str2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( str1_begin == str1_end && *str2 == 0 )
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
template<class StringType1, class StringType2>
|
|
|
|
|
bool EqualNoCase(const StringType1 * str1_begin, const StringType1 * str1_end, const StringType2 * str2)
|
|
|
|
|
{
|
|
|
|
|
return CompareNoCase(str1_begin, str1_end, str2) == 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|