1 --- src/FbTk/StringUtil.cc.orig 2008-06-14 17:36:06.000000000 +0000
2 +++ src/FbTk/StringUtil.cc 2008-06-14 17:39:56.000000000 +0000
5 #include "StringUtil.hh"
15 namespace StringUtil {
19 + * structs needed for std::transform()
20 + * See: http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html#7
23 + ToUpper(std::locale const& l) : loc(l) {;}
24 + char operator() (char c) const { return std::toupper(c,loc); }
26 + std::locale const& loc;
30 + ToLower(std::locale const& l) : loc(l) {;}
31 + char operator() (char c) const { return std::tolower(c,loc); }
33 + std::locale const& loc;
38 Takes a pointer to string *s as an argument,
39 creates a new string n, copies s to n and
43 std::string toLower(const std::string &conv) {
45 + ToLower __tolower(std::locale::classic());
47 std::string ret = conv;
48 - std::transform(ret.begin(), ret.end(), ret.begin(), tolower);
49 + std::transform(ret.begin(), ret.end(), ret.begin(), __tolower);
53 std::string toUpper(const std::string &conv) {
55 + ToUpper __toupper(std::locale::classic());
57 std::string ret = conv;
58 - std::transform(ret.begin(), ret.end(), ret.begin(), toupper);
59 + std::transform(ret.begin(), ret.end(), ret.begin(), __toupper);