本文整理汇总了C++中Path::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ Path::Append方法的具体用法?C++ Path::Append怎么用?C++ Path::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path::Append方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Invoked
/** \brief Invoked
* Handles when an icon within the view is invoked. If it is a directory
* it should, the current directory should move into it. If it is a file
* it should be opened if possible and otherwise it should be downloaded.
*
* \todo Should attempt to dowload and open the remote file if it's not a directory?
* \todo What should be the default action when the file type is unknown?
*/
void RemoteIconView::Invoked( uint nIcon, IconData* pcData )
{
// DEBUG( "RemoteIconView::Invoked on icon %i (%s)\n", nIcon, GetIconString( nIcon, 0 ).c_str() );
RemoteIconData* pcRData = (RemoteIconData*)pcData;
if( pcRData->m_cNode.IsDir() ) {
Path cPath = m_zPath;
cPath.Append( pcRData->m_cNode.m_zName );
DEBUG( "RemoteView: Changing to %s\n", cPath.GetPath().c_str() );
if( m_pcDirChangedMsg ) {
Message cTmp = *m_pcDirChangedMsg;
cTmp.AddString( "file/path", cPath.GetPath() );
Invoke( &cTmp );
}
SetPath( cPath.GetPath() );
}
}
示例2: getAppFolderPath
/**
* @brief Returns the path of folder in which user settings is stored.
* @return user settings folder path.
*/
const Path& WinCoveredCalcApp::getUserSettingsPath()
{
if (userSettingsPath.IsEmpty())
{
Path path;
// Application Data の下
ITEMIDLIST* pIdList;
HRESULT hResult = ::SHGetSpecialFolderLocation(NULL, CSIDL_APPDATA, &pIdList);
if(S_OK == hResult)
{
// 得られた ITEMIDLIST からフォルダ名を取得
TCHAR pathString[MAX_PATH];
if (::SHGetPathFromIDList(pIdList, pathString))
{
path.Assign(pathString);
}
// システムが確保した ITEMIDLIST を解放
IMalloc* pMalloc;
::SHGetMalloc(&pMalloc);
if (NULL != pMalloc)
{
pMalloc->Free(pIdList);
pMalloc->Release();
}
}
if (!path.IsEmpty())
{
userSettingsPath = path.Append(ALITERAL("Hironytic")).Append(ALITERAL("CoveredCalc"));
}
else
{
// Application Data が得られなかったら、アプリケーションのあるフォルダに保存
userSettingsPath = getAppFolderPath();
}
}
return userSettingsPath;
}
示例3: initInstance
//.........这里部分代码省略.........
ExceptionMessageUtils::DoExceptionMessageBox(this, ex);
ex->Delete();
return FALSE;
}
Path langFilePath = selectLangDlg.GetRelativeLangFilePath();
Path langFileFullPath = MakeAbsoluteLangFilePath(langFilePath);
if (!langFileFullPath.IsEmpty())
{
try
{
loadLangFile(langFileFullPath);
langFileLoaded = true;
GetAppSettings()->SetLanguageFilePath(langFilePath);
}
catch (Exception* ex)
{
ex->Delete();
// 言語ファイルが読めません。
DoMessageBox(NSID_EMSG_LOAD_LANGFILE, MessageBoxProvider::ButtonType_OK, MessageBoxProvider::AlertType_Warning);
}
}
}
// キー定義名 DB のロード
loadKeyNameDB();
// キーマッピング読み込み
loadKeyMappingsOnInit();
// カバー読み込み
try
{
AppSettings* appSettings = GetAppSettings();
loadCoverDef(appSettings->GetBaseFolder(), appSettings->GetLastCoverDef(), appSettings->GetLastCoverNo());
}
catch (Exception* ex)
{
ExceptionMessageUtils::DoExceptionMessageBox(this, ex);
ex->Delete();
// デフォルトカバーで復活を試みる
if (!restoreByDefaultCoverDef())
{
// ダメでした…。
return FALSE;
}
}
// メインウィンドウ生成
DWORD exStyle = 0;
if (GetAppSettings()->IsMainWindowAlwaysOnTop())
{
exStyle = WS_EX_TOPMOST;
}
const Point32& lastMainWindowPos = GetAppSettings()->GetLastMainWindowPos();
if (!mainWindow.CreateEx(exStyle, WinMainWindow::GetWindowClassName(), ALITERAL("CoveredCalc"), WS_SYSMENU | WS_POPUP | WS_MINIMIZEBOX, lastMainWindowPos.x, lastMainWindowPos.y, 0, 0, NULL, NULL))
{
// デフォルトカバーにして再チャレンジ
bool restored = false;
if (restoreByDefaultCoverDef())
{
if (mainWindow.CreateEx(exStyle, WinMainWindow::GetWindowClassName(), ALITERAL("CoveredCalc"), WS_SYSMENU | WS_POPUP | WS_MINIMIZEBOX, lastMainWindowPos.x, lastMainWindowPos.y, 0, 0, NULL, NULL))
{
restored = true;
}
}
if (!restored)
{
DoMessageBox(NSID_EMSG_CREATE_MAIN_WINDOW, MessageBoxProvider::ButtonType_OK, MessageBoxProvider::AlertType_Stop);
return FALSE;
}
}
::ShowWindow(mainWindow.m_hWnd, SW_SHOW);
// カバーブラウザ生成
Path baseFolderPath = GetAppSettings()->GetBaseFolder();
if (baseFolderPath.IsEmpty())
{
baseFolderPath = getAppFolderPath();
}
coverBrowser.SetCoversFolderPath(baseFolderPath.Append(ALITERAL("Covers")));
if (!coverBrowser.Create(NULL))
{
DoMessageBox(NSID_EMSG_CREATE_COVER_BROWSER, MessageBoxProvider::ButtonType_OK, MessageBoxProvider::AlertType_Stop);
}
::ShowWindow(mainWindow.m_hWnd, SW_SHOW);
if (GetAppSettings()->IsCoverBrowserVisible())
{
::ShowWindow(coverBrowser.m_hWnd, SW_SHOW);
}
::SetForegroundWindow(mainWindow.m_hWnd);
return TRUE;
}
示例4: Construct
bool Arguments::Construct(char * data, int size)
{
String::Construct(data,size);
StringParser parser;
parser.Assign(*this);
bool error = false;
while ( !error && !parser.Eof() )
{
if (parser.Is('-'))
{
parser.Next();
if (parser.Is('-'))
parser.Next();
Path * path = new Path();
Append(path);
if (parser.ParseWord())
{
if (parser.Eof() || parser.SkipWhitespace())
{
Path * name = new Path();
Path * value = new Path();
path->Append(name);
path->Append(value);
name->Assign(parser.Token);
if (!parser.Is('-'))
{
parser.Mark();
while (!parser.Eof() && !parser.IsWhitespace()) parser.Next();
parser.Trap();
if (!parser.Token.IsEmpty())
value->Assign(parser.Token);
}
}
else
{
error = true;
}
}
else
{
error = true;
}
}
else
{
parser.Mark();
while (!parser.Eof() && !parser.IsWhitespace())
parser.Next();
parser.Trap();
if (!parser.Token.IsEmpty())
{
Path * path = new Path();
path->Assign(parser.Token);
Append(path);
}
}
if ( !error && !parser.Eof() && !parser.SkipWhitespace() && !parser.Is('-'))
error = true;
}
if (error)
{
Release(false);
OutputError("Arguments::Construct - Invalid token in arguments at column %d.",parser.Column());
return false;
}
else
{
return true;
}
}