Changeset 718 in dev for trunk/ab5.0/jenga/include/common
- Timestamp:
- Aug 13, 2008, 10:42:13 PM (16 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.