Changeset 590 in dev
- Timestamp:
- May 10, 2008, 5:53:17 PM (17 years ago)
- Location:
- trunk/ab5.0/jenga
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/jenga/include/common/String.h
r524 r590 11 11 std::string& StringReplace( std::string& str, const std::string sb, const std::string sa ); 12 12 13 std::wstring ToWString( const std::string &str ); 14 13 15 14 16 } -
trunk/ab5.0/jenga/src/common/String.cpp
r518 r590 25 25 return str; 26 26 } 27 28 std::wstring Jenga::Common::ToWString( const std::string &str ) 29 { 30 int size = MultiByteToWideChar( 31 CP_ACP, 32 0, 33 str.c_str(), static_cast<int>(str.size()) + 1, 34 NULL, 0 ) * 2; 35 36 LPWSTR pwstr = (LPWSTR)malloc( size ); 37 38 MultiByteToWideChar( 39 CP_ACP, 40 0, 41 str.c_str(), static_cast<int>(str.size()) + 1, 42 pwstr, static_cast<int>(str.size()) + 1 ); 43 44 std::wstring wstr( pwstr, str.size() ); 45 46 free( pwstr ); 47 48 return wstr; 49 }
Note:
See TracChangeset
for help on using the changeset viewer.