/[enigma]/enigma/px/tools.hh
ViewVC logotype

Diff of /enigma/px/tools.hh

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

revision 1.10 by dheck, Wed Dec 4 19:45:40 2002 UTC revision 1.11 by dheck, Sun Dec 8 20:44:58 2002 UTC
# Line 159  namespace px Line 159  namespace px
159          }          }
160      }      }
161    
162      template <class Ch>      template <class Str>
163      std::basic_string<Ch> trim(const basic_string<Ch>& str)      Str trim(const Str& str)
164      {      {
165          if (str.size() == 0)          if (str.size() == 0)
166              return str;              return str;
167          std::basic_string<Ch>::size_type b = str.find_first_not_of(" \t\n\r");          typename Str::size_type b = str.find_first_not_of(" \t\n\r");
168          std::basic_string<Ch>::size_type e = str.find_last_not_of(" \t\n\r");          typename Str::size_type e = str.find_last_not_of(" \t\n\r");
169          if (b == std::basic_string<Ch>::npos)          if (b == Str::npos)
170              return "";              return "";
171          return basic_string<Ch>(str, b, e-b+1);          return Str(str, b, e-b+1);
172      }      }
173            
174  }  }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26