Ignore:
Timestamp:
Aug 13, 2008, 10:42:13 PM (16 years ago)
Author:
dai
Message:
  • Web設定をオプションダイアログから除去した(不要な機能)。
  • Jenga::Common::Environment::GetUserAppDirメソッドを追加。
  • Jenga::Common::Directoryクラスコンストラクタを修正。
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/jenga/include/common/Environment.h

    r524 r718  
    1919    {
    2020        static std::string appDir;
    21         if( appDir.size() == 0 )
     21        if( appDir.empty() )
    2222        {
    2323            char temporary[MAX_PATH];
     
    4040    {
    4141        static std::string appFileName;
    42         if( appFileName.size() == 0 )
     42        if( appFileName.empty() )
    4343        {
    4444            char temporary[MAX_PATH];
     
    5757    {
    5858        static std::string appFilePath;
    59         if( appFilePath.size() == 0 )
     59        if( appFilePath.empty() )
    6060        {
    6161            char temporary[MAX_PATH];
     
    6666        return appFilePath;
    6767    }
     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    }
    6889};
    6990
Note: See TracChangeset for help on using the changeset viewer.