ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/utils/StringUtils.hpp
(Generate patch)

Comparing trunk/OOPSE-4/src/utils/StringUtils.hpp (file contents):
Revision 1945 by tim, Fri Jan 14 16:49:46 2005 UTC vs.
Revision 1980 by tim, Mon Feb 7 19:13:43 2005 UTC

# Line 113 | Line 113 | namespace oopse {
113      template<typename T>
114      std::string toString(const T& v) {
115          std::ostringstream oss;        
116 <        oss << v;
116 >        if (!oss << v) {
117 >            std::cerr << "toString Error" << std::endl;
118 >        }
119          return oss.str();
120      }
121  
122 +    template<typename T>
123 +    T lexi_cast(const std::string& str) {
124 +        T result;
125 +        std::istringstream iss(str);        
126 +        if (!(iss >> result)) {
127 +            std::cerr << "lexi_cast Error" << std::endl;
128 +        }
129 +        return result;
130 +    }
131 +
132      /**@todo need implementation */
133      std::string getPrefix(const std::string& str);
134  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines