#ifndef Morpheo_FromString_h #define Morpheo_FromString_h /* * $Id: FromString.h 88 2008-12-10 18:31:39Z rosiere $ * * [ Description ] * */ // #include // #include // #include #include // #include namespace morpheo { template inline T fromString (const std::string& x) { return static_cast(x.c_str()); } template<> inline uint32_t fromString (const std::string& x) { return static_cast(atoi(x.c_str())); } template<> inline uint64_t fromString (const std::string& x) { return static_cast(atoll(x.c_str())); } template<> inline double fromString (const std::string& x) { return static_cast(atof(x.c_str())); } template<> inline bool fromString (const std::string& x) { return atoi(x.c_str())!=0; } }; // end namespace morpheo #endif