10 class IsNotSpace : public std::unary_function<bool, char> {
12 IsNotSpace(const std::locale & l) : loc(l) {};
13 bool operator() (char c)
15 return !std::use_facet<casefacet>(loc).is(std::ctype_base::space, c);
18 const std::locale & loc;
20 typedef std::ctype<char> casefacet;
23 class ToLowerHelper : public std::unary_function<char, char> {
25 ToLowerHelper(const std::locale & l) : loc(l) {};
26 char operator() (char c)
28 return std::tolower(c, loc);
31 const std::locale & loc;
34 class ToUpperHelper : public std::unary_function<char, char> {
36 ToUpperHelper(const std::locale & l) : loc(l) {};
37 char operator() (char c)
39 return std::toupper(c, loc);
42 const std::locale & loc;
45 std::string Trim(const std::string & val, const std::locale & loc);
46 std::string ToLower(const std::string & val, const std::locale & loc);
47 std::string ToUpper(const std::string & val, const std::locale & loc);
49 inline std::string Trim(const std::string & val)
51 return Trim(val, std::locale(""));
54 inline std::string ToLower(const std::string & val)
56 return ToLower(val, std::locale(""));
59 inline std::string ToUpper(const std::string & val)
61 return ToUpper(val, std::locale(""));
66 std::string inet_ntostring(uint32_t ip);