]> git.pld-linux.org Git - packages/fbpager.git/blob - fbpager-gcc43.patch
- working mirror for source0
[packages/fbpager.git] / fbpager-gcc43.patch
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
3 @@ -23,6 +23,9 @@
4  
5  #include "StringUtil.hh"
6  
7 +
8 +#include <cstring>
9 +#include <locale>
10  #include <string>
11  #include <cstdio>
12  #include <cstdlib>
13 @@ -37,6 +40,26 @@
14  
15  namespace StringUtil {
16  
17 +
18 +/* 
19 + * structs needed for std::transform() 
20 + * See: http://gcc.gnu.org/onlinedocs/libstdc++/22_locale/howto.html#7 
21 + */ 
22 +struct ToUpper { 
23 +  ToUpper(std::locale const& l) : loc(l) {;} 
24 +  char operator() (char c) const  { return std::toupper(c,loc); } 
25 + private: 
26 +  std::locale const& loc; 
27 +}; 
28 +        
29 +struct ToLower { 
30 +  ToLower(std::locale const& l) : loc(l) {;} 
31 +  char operator() (char c) const  { return std::tolower(c,loc); } 
32 +private: 
33 +  std::locale const& loc; 
34 +}; 
35 +
36 +
37  /**
38     Takes a pointer to string *s as an argument,
39     creates a new string n, copies s to n and
40 @@ -160,14 +183,20 @@
41  }
42  
43  std::string toLower(const std::string &conv) {
44 +
45 +    ToLower __tolower(std::locale::classic());
46 +
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);
50      return ret;
51  }
52  
53  std::string toUpper(const std::string &conv) {
54 +
55 +    ToUpper __toupper(std::locale::classic());
56 +
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);
60      return ret;
61  }
62  
63
This page took 0.045109 seconds and 3 git commands to generate.