| 66 | |
| 67 | // Parses a string into a number |
| 68 | template<typename T> inline T Parse(const std::wstring& str) |
| 69 | { |
| 70 | std::wistringstream stream(str); |
| 71 | wchar_t c; |
| 72 | T x; |
| 73 | if(!(str >> x) || stream.get(c)) |
| 74 | throw Exception(L"Can't parse string \"" + str + L"\""); |
| 75 | return x; |
| 76 | } |
| 77 | |
| 78 | // Converts a number to a string |
| 79 | template<typename T> inline std::wstring ToString(const T& val) |