Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

stringutils.h

Go to the documentation of this file.
00001 
00007 #ifndef __STRINGUTILS_H__
00008 #define __STRINGUTILS_H__
00009 
00010 #include "stringparser.h"
00011 
00013 namespace String {
00014   
00020 template<class T>
00021 string stringrep(const T& item)
00022 {
00023   ostrstream os;
00024   os << item << ends;
00025   return string(os.str());
00026 }
00027 
00028 
00029 
00031 template <class String>
00032 bool non_numeric_basename_matches(const String& a, const String& b)
00033 {
00034   return (String(a.begin(),a.find_last_not_of("0123456789")) ==
00035           String(b.begin(),b.find_last_not_of("0123456789")) );
00036 }
00037 
00038 
00039 
00042 template <class T, class String>
00043 T numeric_extension(const String& a)
00044 {
00045   String b=a;
00046   b.erase(0,b.find_last_not_of("0123456789")+1);
00047   T result;
00048   const StringParser sp;
00049   return sp.parse(b,result);
00050 }
00051 
00052 
00053 } /* namespace String */
00054 
00055 #endif /* __STRINGUTILS_H__ */

Generated at Mon Aug 21 00:30:55 2000 for RF-LISSOM by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000