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

Comparing branches/new_design/OOPSE-3.0/src/utils/StringUtils.hpp (file contents):
Revision 1804 by tim, Mon Nov 29 17:59:56 2004 UTC vs.
Revision 1805 by tim, Tue Nov 30 20:50:47 2004 UTC

# Line 10 | Line 10
10   #include <string>
11   #include <iostream>
12   #include <fstream>
13 + #include <sstream>
14  
15   namespace oopse {
16  
# Line 63 | Line 64 | namespace oopse {
64     */
65    int isEndLine(char *line);
66  
67 +
68 +  /**
69 +   * Convert a variable to a string
70 +   * @param T data type
71 +   * @param v data to be converted
72 +   * @return a string
73 +   */
74 +    template<typename T>
75 +    std::string toString(const T& v) {
76 +        std::ostringstream oss;
77 +        T result;
78 +        
79 +        oss << v;
80 +        return oss.str();
81 +    }
82 +    
83   }
84  
85   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines