Changeset 718 in dev for trunk/ab5.0/jenga
- Timestamp:
- Aug 13, 2008, 10:42:13 PM (16 years ago)
- Location:
- trunk/ab5.0/jenga
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/jenga/include/common/Environment.h
r524 r718 19 19 { 20 20 static std::string appDir; 21 if( appDir. size() == 0)21 if( appDir.empty() ) 22 22 { 23 23 char temporary[MAX_PATH]; … … 40 40 { 41 41 static std::string appFileName; 42 if( appFileName. size() == 0)42 if( appFileName.empty() ) 43 43 { 44 44 char temporary[MAX_PATH]; … … 57 57 { 58 58 static std::string appFilePath; 59 if( appFilePath. size() == 0)59 if( appFilePath.empty() ) 60 60 { 61 61 char temporary[MAX_PATH]; … … 66 66 return appFilePath; 67 67 } 68 69 static const std::string &GetUserAppDir() 70 { 71 static std::string userAppDir; 72 if( userAppDir.empty() ) 73 { 74 char szDirPath[MAX_PATH]; 75 if( SHGetSpecialFolderPath( NULL, szDirPath, CSIDL_APPDATA, TRUE ) == FALSE ) 76 { 77 throw; 78 } 79 userAppDir = szDirPath; 80 81 if( userAppDir[userAppDir.size()-1] == '\\' ) 82 { 83 userAppDir = userAppDir.substr( 0, userAppDir.size() - 1 ); 84 } 85 } 86 87 return userAppDir; 88 } 68 89 }; 69 90 -
trunk/ab5.0/jenga/src/common/Directory.cpp
r694 r718 8 8 if ( isMake ) 9 9 { 10 if (!::MakeSureDirectoryPathExists(path.c_str())) 10 std::string tempPath = path; 11 if( !tempPath.empty() && tempPath[tempPath.size()-1] != '\\' ) 12 { 13 tempPath += "\\"; 14 } 15 if (!::MakeSureDirectoryPathExists(tempPath.c_str())) 11 16 { 12 17 Jenga::Throw( "MakeSureDirectoryPathExists failed!" );
Note:
See TracChangeset
for help on using the changeset viewer.