# | 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 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |