Use 'char' instead of 'unsigned char' for conversion with std::ctype.

This commit is contained in:
Vincent Richard 2006-11-09 17:27:18 +00:00
parent f99fc84915
commit b63f6513f2

View File

@ -33,8 +33,8 @@ const bool stringUtils::isStringEqualNoCase
if (s1.length() < n) if (s1.length() < n)
return (false); return (false);
const std::ctype <unsigned char>& fac = const std::ctype <char>& fac =
std::use_facet <std::ctype <unsigned char> >(std::locale::classic()); std::use_facet <std::ctype <char> >(std::locale::classic());
bool equal = true; bool equal = true;
@ -50,8 +50,8 @@ const bool stringUtils::isStringEqualNoCase(const string& s1, const string& s2)
if (s1.length() != s2.length()) if (s1.length() != s2.length())
return (false); return (false);
const std::ctype <unsigned char>& fac = const std::ctype <char>& fac =
std::use_facet <std::ctype <unsigned char> >(std::locale::classic()); std::use_facet <std::ctype <char> >(std::locale::classic());
bool equal = true; bool equal = true;
const string::const_iterator end = s1.end(); const string::const_iterator end = s1.end();
@ -70,8 +70,8 @@ const bool stringUtils::isStringEqualNoCase
if (static_cast <string::size_type>(end - begin) < n) if (static_cast <string::size_type>(end - begin) < n)
return (false); return (false);
const std::ctype <unsigned char>& fac = const std::ctype <char>& fac =
std::use_facet <std::ctype <unsigned char> >(std::locale::classic()); std::use_facet <std::ctype <char> >(std::locale::classic());
bool equal = true; bool equal = true;
char* c = const_cast<char*>(s); char* c = const_cast<char*>(s);
@ -86,8 +86,8 @@ const bool stringUtils::isStringEqualNoCase
const string stringUtils::toLower(const string& str) const string stringUtils::toLower(const string& str)
{ {
const std::ctype <unsigned char>& fac = const std::ctype <char>& fac =
std::use_facet <std::ctype <unsigned char> >(std::locale::classic()); std::use_facet <std::ctype <char> >(std::locale::classic());
string out; string out;
out.resize(str.size()); out.resize(str.size());
@ -101,8 +101,8 @@ const string stringUtils::toLower(const string& str)
const string stringUtils::toUpper(const string& str) const string stringUtils::toUpper(const string& str)
{ {
const std::ctype <unsigned char>& fac = const std::ctype <char>& fac =
std::use_facet <std::ctype <unsigned char> >(std::locale::classic()); std::use_facet <std::ctype <char> >(std::locale::classic());
string out; string out;
out.resize(str.size()); out.resize(str.size());