/[svn]/gigedit/trunk/src/gigedit/global.h
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/global.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3307 by schoenebeck, Tue Jul 11 23:06:38 2017 UTC revision 3341 by schoenebeck, Mon Jul 31 11:26:56 2017 UTC
# Line 25  Line 25 
25  #endif  #endif
26    
27  #include <cstring>  #include <cstring>
28    #include <algorithm>
29    
30  #include <glibmmconfig.h>  #include <glibmmconfig.h>
31  // threads.h must be included first to be able to build with  // threads.h must be included first to be able to build with
# Line 116  gig::String gig_from_utf8(const Glib::us Line 117  gig::String gig_from_utf8(const Glib::us
117      return Glib::convert_with_fallback(utf8_string, GIG_STR_ENCODING, "UTF-8", "?");      return Glib::convert_with_fallback(utf8_string, GIG_STR_ENCODING, "UTF-8", "?");
118  }  }
119    
120    inline Glib::ustring ltrim(Glib::ustring s) {
121        s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
122        return s;
123    }
124    
125    inline Glib::ustring rtrim(Glib::ustring s) {
126        s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
127        return s;
128    }
129    
130    inline Glib::ustring trim(Glib::ustring s) {
131        return ltrim(rtrim(s));
132    }
133    
134  template<class T> inline std::string ToString(T o) {  template<class T> inline std::string ToString(T o) {
135      std::stringstream ss;      std::stringstream ss;
136      ss << o;      ss << o;

Legend:
Removed from v.3307  
changed lines
  Added in v.3341

  ViewVC Help
Powered by ViewVC