Changeset 747 in dev
- Timestamp:
- Sep 15, 2008, 4:41:01 PM (16 years ago)
- Location:
- trunk/ab5.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/ab_common/src/Lexical/DataTable.cpp
r700 r747 39 39 int DataTable::AddWString( const std::wstring &wstr ) 40 40 { 41 return AddBinary( wstr.c_str(), static_cast<int>( wstr.size()) + sizeof(wchar_t));41 return AddBinary( wstr.c_str(), static_cast<int>((wstr.length()+1)*sizeof(wchar_t))); 42 42 } 43 43 int DataTable::AddSpace( int size ) -
trunk/ab5.0/jenga/include/common/String.h
r622 r747 12 12 13 13 std::string ToString( int n ); 14 std::string ToString( const std::wstring &wstr ); 14 15 std::wstring ToWString( const std::string &str ); 15 16 -
trunk/ab5.0/jenga/src/common/String.cpp
r745 r747 33 33 } 34 34 35 std::string Jenga::Common::ToString( const std::wstring &wstr ) 36 { 37 char *pstr = (char *)malloc( wstr.length() + 1 ); 38 39 WideCharToMultiByte( 40 CP_ACP, 41 0, 42 wstr.c_str(), -1, 43 pstr, static_cast<int>(wstr.length()) + 1, 44 NULL, NULL ); 45 46 std::string result = pstr; 47 48 free( pstr ); 49 50 return result; 51 } 52 35 53 std::wstring Jenga::Common::ToWString( const std::string &str ) 36 54 { … … 41 59 NULL, 0 ) * 4; 42 60 43 LPWSTR pwstr = (LPWSTR) malloc( size);61 LPWSTR pwstr = (LPWSTR)calloc( size, 1 ); 44 62 45 63 MultiByteToWideChar(
Note:
See TracChangeset
for help on using the changeset viewer.