Changeset 66 for trunk/IPs/systemC/processor/Morpheo/Common/include
- Timestamp:
- Dec 6, 2007, 11:03:00 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Common/include/ToString.h
r43 r66 5 5 * $Id$ 6 6 * 7 * [ Description ] 7 * with a stephane dubuisson initial idea 8 * 9 * [ Description ] 8 10 * 9 11 */ … … 23 25 template<typename T> inline std::string toString (const T& x) 24 26 { 25 ostringstream out ;27 ostringstream out(""); 26 28 out << x; 27 29 return out.str(); … … 30 32 template<> inline std::string toString<bool> (const bool& x) 31 33 { 32 ostringstream out ;34 ostringstream out(""); 33 35 //out << boolalpha << x; 34 36 out << x; … … 39 41 { 40 42 const int sigdigits = std::numeric_limits<float>::digits10; 41 ostringstream out ;43 ostringstream out(""); 42 44 out << setprecision(sigdigits) << x; 43 45 return out.str(); … … 47 49 { 48 50 const int sigdigits = std::numeric_limits<double>::digits10; 49 ostringstream out ;51 ostringstream out(""); 50 52 out << setprecision(sigdigits) << x; 51 53 return out.str(); … … 55 57 { 56 58 const int sigdigits = std::numeric_limits<long double>::digits10; 57 ostringstream out ;59 ostringstream out(""); 58 60 out << setprecision(sigdigits) << x; 59 61 return out.str(); 60 62 } 63 64 // template<> inline std::string toString< int8_t> (const int8_t& x) 65 // { 66 // ostringstream out(""); 67 // out << x; 68 // return out.str(); 69 // } 70 71 // template<> inline std::string toString<uint8_t> (const uint8_t& x) 72 // { 73 // ostringstream out(""); 74 // out << x; 75 // return out.str(); 76 // } 77 78 // template<> inline std::string toString< int16_t> (const int16_t& x) 79 // { 80 // ostringstream out(""); 81 // out << x; 82 // return out.str(); 83 // } 84 85 // template<> inline std::string toString<uint16_t> (const uint16_t& x) 86 // { 87 // ostringstream out(""); 88 // out << x; 89 // return out.str(); 90 // } 91 92 // template<> inline std::string toString< int32_t> (const int32_t& x) 93 // { 94 // ostringstream out(""); 95 // out << x; 96 // return out.str(); 97 // } 98 99 // template<> inline std::string toString<uint32_t> (const uint32_t& x) 100 // { 101 // ostringstream out(""); 102 // out << x; 103 // return out.str(); 104 // } 61 105 62 106 }; // end namespace morpheo
Note: See TracChangeset
for help on using the changeset viewer.