#include <cexception.h>#include <iostream>#include <sstream>#include <string>Go to the source code of this file.
Functions | |
| template<class t > | |
| t | convertString (const std::string &str) |
| template<class t > | |
| std::string | convertToString (const t &val) |
Definition in file StringConvert.h.
| t convertString | ( | const std::string & | str | ) | [inline] |
Definition at line 29 of file StringConvert.h.
00029 { 00030 std::istringstream s(str); 00031 t buf; 00032 if (!(s >> buf)) { 00033 throw( cException("convertString: parsing of string %s failed", str.c_str()) ); 00034 } 00035 return buf; 00036 }
| std::string convertToString | ( | const t & | val | ) | [inline] |
Definition at line 38 of file StringConvert.h.
00038 { 00039 std::ostringstream s; 00040 if (!(s << val)) { 00041 throw( cException("convertToString: cannot convert value to string") ); 00042 } 00043 return s.str(); 00044 }
1.5.8