- Timestamp:
- Mar 27, 2008, 11:04:49 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Common/include/FromString.h
r43 r78 17 17 namespace morpheo { 18 18 19 template<typename T> inline T fromString (const std::string& x)19 template<typename T> inline T fromString (const std::string& x) 20 20 { 21 21 return static_cast<T>(x.c_str()); 22 22 } 23 23 24 template<> inline int fromString<int>(const std::string& x)24 template<> inline uint32_t fromString<uint32_t> (const std::string& x) 25 25 { 26 return atoi(x.c_str()); 26 return static_cast<uint32_t>(atoi(x.c_str())); 27 } 28 29 template<> inline bool fromString<bool> (const std::string& x) 30 { 31 return atoi(x.c_str())!=0; 27 32 } 28 33
Note: See TracChangeset
for help on using the changeset viewer.