diff -c -r -N ../Ice-3.3.0/cpp/include/IceUtil/StringUtil.h ./cpp/include/IceUtil/StringUtil.h *** ../Ice-3.3.0/cpp/include/IceUtil/StringUtil.h 2008-05-16 14:54:00.000000000 -0230 --- ./cpp/include/IceUtil/StringUtil.h 2008-10-30 12:51:39.000000000 -0230 *************** *** 65,70 **** --- 65,82 ---- #else ICE_UTIL_API std::string errorToString(int); #endif + + // + // Functions to convert to to all lower/upper case + // + ICE_UTIL_API std::string toLower(const std::string&); + ICE_UTIL_API std::string toUpper(const std::string&); + + // + // Remove all whitespace from a string + // + ICE_UTIL_API std::string removeWhitespace(const std::string&); + } #endif diff -c -r -N ../Ice-3.3.0/cpp/src/IcePatch2/Calc.cpp ./cpp/src/IcePatch2/Calc.cpp *** ../Ice-3.3.0/cpp/src/IcePatch2/Calc.cpp 2008-05-16 14:54:00.000000000 -0230 --- ./cpp/src/IcePatch2/Calc.cpp 2008-10-30 13:04:19.000000000 -0230 *************** *** 42,48 **** for(string::size_type i = 0; i < lhs.path.size(); ++i) { ! if(::tolower(lhs.path[i]) != ::tolower(rhs.path[i])) { return false; } --- 42,48 ---- for(string::size_type i = 0; i < lhs.path.size(); ++i) { ! if(::tolower(static_cast(lhs.path[i])) != ::tolower(static_cast(rhs.path[i]))) { return false; } *************** *** 59,69 **** { for(string::size_type i = 0; i < lhs.path.size() && i < rhs.path.size(); ++i) { ! if(::tolower(lhs.path[i]) < ::tolower(rhs.path[i])) { return true; } ! else if(::tolower(lhs.path[i]) > ::tolower(rhs.path[i])) { return false; } --- 59,70 ---- { for(string::size_type i = 0; i < lhs.path.size() && i < rhs.path.size(); ++i) { ! if(::tolower(static_cast(lhs.path[i])) < ::tolower(static_cast(rhs.path[i]))) { return true; } ! else if(::tolower(static_cast(lhs.path[i])) > ! ::tolower(static_cast(rhs.path[i]))) { return false; } diff -c -r -N ../Ice-3.3.0/cpp/src/IcePatch2/Client.cpp ./cpp/src/IcePatch2/Client.cpp *** ../Ice-3.3.0/cpp/src/IcePatch2/Client.cpp 2008-05-16 14:54:00.000000000 -0230 --- ./cpp/src/IcePatch2/Client.cpp 2008-10-30 12:58:41.000000000 -0230 *************** *** 8,13 **** --- 8,14 ---- // ********************************************************************** #include + #include #include #include #include *************** *** 54,60 **** { cout << "Do a thorough patch? (yes/no)" << endl; cin >> answer; ! transform(answer.begin(), answer.end(), answer.begin(), ::tolower); if(answer == "no") { return false; --- 55,61 ---- { cout << "Do a thorough patch? (yes/no)" << endl; cin >> answer; ! answer = IceUtilInternal::toLower(answer); if(answer == "no") { return false; diff -c -r -N ../Ice-3.3.0/cpp/src/IcePatch2/Util.cpp ./cpp/src/IcePatch2/Util.cpp *** ../Ice-3.3.0/cpp/src/IcePatch2/Util.cpp 2008-05-16 14:54:00.000000000 -0230 --- ./cpp/src/IcePatch2/Util.cpp 2008-10-30 13:01:05.000000000 -0230 *************** *** 280,286 **** } if(result == "/." || ! (result.size() == 4 && isalpha(result[0]) && result[1] == ':' && result[2] == '/' && result[3] == '.')) { return result.substr(0, result.size() - 1); } --- 280,287 ---- } if(result == "/." || ! (result.size() == 4 && isalpha(static_cast(result[0])) && result[1] == ':' && ! result[2] == '/' && result[3] == '.')) { return result.substr(0, result.size() - 1); } *************** *** 290,296 **** result.erase(result.size() - 2, 2); } ! if(result == "/" || (result.size() == 3 && isalpha(result[0]) && result[1] == ':' && result[2] == '/')) { return result; } --- 291,298 ---- result.erase(result.size() - 2, 2); } ! if(result == "/" || (result.size() == 3 && isalpha(static_cast(result[0])) && ! result[1] == ':' && result[2] == '/')) { return result; } *************** *** 317,328 **** } unsigned i = 0; ! while(isspace(pa[i])) { ++i; } #ifdef _WIN32 ! return pa[i] == '\\' || pa[i] == '/' || pa.size() > i + 1 && isalpha(pa[i]) && pa[i + 1] == ':'; #else return pa[i] == '/'; #endif --- 319,331 ---- } unsigned i = 0; ! while(isspace(static_cast(pa[i]))) { ++i; } #ifdef _WIN32 ! return pa[i] == '\\' || pa[i] == '/' || pa.size() > i + 1 && ! isalpha(static_cast(pa[i])) && pa[i + 1] == ':'; #else return pa[i] == '/'; #endif *************** *** 333,339 **** { string path = simplify(pa); #ifdef _WIN32 ! return path == "/" || path.size() == 3 && isalpha(path[0]) && path[1] == ':' && path[2] == '/'; #else return path == "/"; #endif --- 336,343 ---- { string path = simplify(pa); #ifdef _WIN32 ! return path == "/" || path.size() == 3 && isalpha(static_cast(path[0])) && ! path[1] == ':' && path[2] == '/'; #else return path == "/"; #endif diff -c -r -N ../Ice-3.3.0/cpp/src/IceUtil/StringUtil.cpp ./cpp/src/IceUtil/StringUtil.cpp *** ../Ice-3.3.0/cpp/src/IceUtil/StringUtil.cpp 2008-05-16 14:54:01.000000000 -0230 --- ./cpp/src/IceUtil/StringUtil.cpp 2008-10-30 12:55:40.000000000 -0230 *************** *** 687,690 **** --- 687,726 ---- return errorToString(errno); } #endif + + string + IceUtilInternal::toLower(const std::string& s) + { + string result; + for(unsigned int i = 0; i < s.length(); ++ i) + { + result += tolower(static_cast(s[i])); + } + return result; + } + + string + IceUtilInternal::toUpper(const std::string& s) + { + string result; + for(unsigned int i = 0; i < s.length(); ++ i) + { + result += toupper(static_cast(s[i])); + } + return result; + } + + string + IceUtilInternal::removeWhitespace(const std::string& s) + { + string result; + for(unsigned int i = 0; i < s.length(); ++ i) + { + if(!isspace(static_cast(s[i]))) + { + result += s[i]; + } + } + return result; + } +