1 #ifndef __STRING_CONVERSION_H__ 2 #define __STRING_CONVERSION_H__ 3 4 #include <string> 5 6 namespace conversion 7 { 8 #ifdef _UNICODE fromStringToWString(const std::string & input)9 static std::wstring fromStringToWString(const std::string& input) 10 { 11 std::wstring tmp; 12 tmp.assign(input.begin(), input.end()); 13 return tmp; 14 } 15 fromWStringToString(const std::wstring & input)16 static std::string fromWStringToString(const std::wstring& input) 17 { 18 std::string tmp; 19 tmp.assign(input.begin(), input.end()); 20 return tmp; 21 } 22 #else 23 static std::string fromStringToWString(const std::string& input) 24 { 25 return input; 26 } 27 28 static std::string fromWStringToString(const std::string& input) 29 { 30 return input; 31 } 32 33 #endif 34 } 35 36 #endif 37