當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetPathName函數代碼示例

本文整理匯總了C++中GetPathName函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetPathName函數的具體用法?C++ GetPathName怎麽用?C++ GetPathName使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetPathName函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: Update

// Check filename and update preview
BOOL DFUFileDialog::Update()
{
	// Update the preview
	CString comment;
	CStringX xcomment;
	bool valid = false;
	if (GetPathName().IsEmpty()
		|| !DFUEngine::IsDFUFileValid(GetPathName(), xcomment))
	{
		comment.Format(m_bOpenFileDialog
		               ? IDS_FILE_SELECT_NONE_OPEN
					   : IDS_FILE_SELECT_NONE_SAVE);
	}
	else
	{
		comment = xcomment;

		valid = true;
		if (comment.IsEmpty())
		{
			comment.Format(IDS_FILE_SELECT_NO_COMMENT, (LPCTSTR) GetFileName());
		}
	}
	editPreview.SetWindowText(comment);
	editPreview.EnableScrollBarCtrl(SB_VERT, true);
	if (editPreview.GetScrollLimit(SB_VERT) == 0)
	{
		editPreview.EnableScrollBarCtrl(SB_VERT, false);
	}

	// Return whether the file is valid
	return valid;
}
開發者ID:philiplin4sp,項目名稱:production-test-tool,代碼行數:34,代碼來源:DFUFileDialog.cpp

示例2: SetModifiedFlag

void CBonfireDoc::OnFileReload() 
{
	if (!GetPathName().IsEmpty())
	{
		SetModifiedFlag(FALSE);
		m_xTextBuffer.FreeAll();
		m_xTextBuffer.LoadFromFile(GetPathName(),
			CRLF_STYLE_AUTOMATIC,ExistsSourceView(GetPathName()));
		UpdateAllViews(NULL);
	}
}
開發者ID:Qeeet,項目名稱:nz-software,代碼行數:11,代碼來源:BonfireDoc.cpp

示例3: OnFileSaveAs

void CColorEyeIDoc::OnFileSave() 
{
    // TODO: Add your command handler code here
//    SetPathName()
    if (GetPathName().IsEmpty())            //若還沒有存過的檔
        OnFileSaveAs();                     //就另存新檔
    else
    {
        SetModifiedFlag(FALSE);
//        saveTxtFile(GetPathName());
         saveOmdFile(GetPathName());
    }
    SetModifiedFlag(FALSE);
}
開發者ID:dwatow,項目名稱:ColorEyeI,代碼行數:14,代碼來源:ColorEyeIDoc.cpp

示例4: UE_LOG

void USoundWave::GetChunkData(int32 ChunkIndex, uint8** OutChunkData)
{
	if (RunningPlatformData->TryLoadChunk(ChunkIndex, OutChunkData) == false)
	{
		// Unable to load chunks from the cache. Rebuild the sound and try again.
		UE_LOG(LogAudio, Warning, TEXT("GetChunkData failed for %s"), *GetPathName());
#if WITH_EDITORONLY_DATA
		ForceRebuildPlatformData();
		if (RunningPlatformData->TryLoadChunk(ChunkIndex, OutChunkData) == false)
		{
			UE_LOG(LogAudio, Error, TEXT("Failed to build sound %s."), *GetPathName());
		}
#endif // #if WITH_EDITORONLY_DATA
	}
}
開發者ID:1vanK,項目名稱:AHRUnrealEngine,代碼行數:15,代碼來源:SoundWave.cpp

示例5: GetFileExtension

BOOL CBonfireDoc::ExistsSourceView(LPCTSTR lpszPathName)
{
	CStringList pTabList;
	CString ext = (lpszPathName == NULL) 
				? GetFileExtension(GetPathName()) 
				: GetFileExtension(lpszPathName);
	
	// generate tabs based on the file extension
	CString strViews	= theApp.m_opOptions.views.vAssociations[0].strViews; // init to default views
	CString strExtList	= "";
	size_t nExt			= theApp.m_opOptions.views.vAssociations.size();
	
	// see if the current file's extension is in the list
	while (nExt-- > 0) // 0 is the default file extension
	{
		strExtList = (CString)theApp.m_opOptions.views.vAssociations[nExt].strExtensions;
		strExtList.Remove(' ');

		if (IsStringPresent(strExtList, ext))
		{
			strViews = theApp.m_opOptions.views.vAssociations[nExt].strViews;
			break;
		}
	}

	return (strViews[0] != '-' || strViews[0] == 's');
}
開發者ID:Qeeet,項目名稱:nz-software,代碼行數:27,代碼來源:BonfireDoc.cpp

示例6: dlg

bool CTwiBootProgDoc::SaveFileAs()
{
    CFileDialog dlg(FALSE, NULL, NULL, OFN_HIDEREADONLY, m_strFileTypeFilter, NULL);
    CString FilePath = GetPathName();
    CString FileName = GetTitle();
    if (FilePath.IsEmpty())
        FilePath = FileName;
    dlg.m_ofn.lpstrTitle = FileName;
    dlg.m_ofn.lpstrFile = FilePath.GetBuffer(_MAX_PATH);
    INT_PTR res = dlg.DoModal();
    FilePath.ReleaseBuffer();
    if (res == IDCANCEL)
        return false;
    CString FileExt = dlg.GetFileExt();

    switch(dlg.m_ofn.nFilterIndex)
    {
    case 1:
        m_FileType = ftBinary;
        if (FileExt.IsEmpty())
            FilePath += ".bin";
        break;
    case 2:
        m_FileType = ftIntelHex;
        if (FileExt.IsEmpty())
            FilePath += ".hex";
        break;
    default:
        ASSERT(FALSE);
        return false;
    }
    SetPathName(FilePath);
    SetTitle(FilePath);
    return SaveFile();
}
開發者ID:AndySze,項目名稱:OpenServo,代碼行數:35,代碼來源:TwiBootProgDoc.cpp

示例7: UE_LOG

void UEdGraphNode::PostLoad()
{
	Super::PostLoad();

	// Create Guid if not present (and not CDO)
	if(!NodeGuid.IsValid() && !IsTemplate() && GetLinker() && GetLinker()->IsPersistent() && GetLinker()->IsLoading())
	{
		UE_LOG(LogBlueprint, Warning, TEXT("Node '%s' missing NodeGuid."), *GetPathName());

		// Generate new one
		CreateNewGuid();
	}

	// Duplicating a Blueprint needs to have a new Node Guid generated, which was not occuring before this version
	if(GetLinkerUE4Version() < VER_UE4_POST_DUPLICATE_NODE_GUID)
	{
		// Generate new one
		CreateNewGuid();
	}
	// Moving to the new style comments requires conversion to preserve previous state
	if(GetLinkerUE4Version() < VER_UE4_GRAPH_INTERACTIVE_COMMENTBUBBLES)
	{
		bCommentBubbleVisible = !NodeComment.IsEmpty();
	}
}
開發者ID:amyvmiwei,項目名稱:UnrealEngine4,代碼行數:25,代碼來源:EdGraphNode.cpp

示例8: OnFileSaveAs

void CKaiDoc::OnFileSave()
{
    // TODO: Add your command handler code here
    if (pco_Doc_->b_IsImported())
    {
        OnFileSaveAs();
        return;
    }

    CString cstr_path = GetPathName();
    if (!cstr_path.IsEmpty())
    {
        CString cstr_ext = PathFindExtension (cstr_path);
        SetPathName (CString (cstr_path.Left (cstr_path.GetLength() - 
                                              cstr_ext.GetLength())) + 
                              _T(".kai"));
    }
    else
    {
        SetTitle (pco_Doc_->str_Title_.data());
    }

    CDocument::OnFileSave();

    if (IsModified())
    {
        SetTitle (CString (pco_Doc_->str_Title_.data()) + _T("*"));
    }

}
開發者ID:kbogatyrev,項目名稱:Kai,代碼行數:30,代碼來源:KaiDoc.cpp

示例9: sndPlaySound

void CWaveOpen::OnBtnPlay() {
	sndPlaySound( NULL, NULL );
	CString str = GetPathName();
	if( str.GetLength() > 0 ) {
		sndPlaySound( str, SND_FILENAME | SND_ASYNC );
	}
}
開發者ID:SL987654,項目名稱:The-Darkmod-Experimental,代碼行數:7,代碼來源:WaveOpen.cpp

示例10: GetPathName

CString CGenethonDoc::ConvertPathname( const char *nExt )
{
    char *pName;
    CString PathName = GetPathName();

    int NameLen = PathName.GetLength();

    pName = PathName.GetBuffer(NameLen);

    int tLen = NameLen - 1;
    int i;
    for ( i = 0; i < 4; ++i ) {
        if ( pName[tLen] == '.' ) {
            break;
        }
        tLen--;
    }

    if ( pName[tLen] == '.' ) {
        i = 0;
        while ( (tLen < NameLen) && (i < 4) ) {
            pName[tLen] = nExt[i];
            i++;
            tLen++;
        }
        PathName.ReleaseBuffer();
    } else {
        PathName.ReleaseBuffer();
        PathName += nExt;
    }

    return PathName;
}
開發者ID:karlnicholas,項目名稱:GeneThon,代碼行數:33,代碼來源:GenethonDoc.cpp

示例11: OnSaveDocument

void CStorageDoc::Close (bool blAsk/* = true*/, bool blSave/* = true*/) {
	if (blSave)
		OnSaveDocument (GetPathName ());
	if (!blAsk)
		SetModifiedFlag (false);
	OnCloseDocument ();
}
開發者ID:macx0r,項目名稱:dias-inet,代碼行數:7,代碼來源:StorageDoc.cpp

示例12: AddDirToVhd

//Implementation of CreateDirectory.
BOOL APIENTRY AddDirToVhd(HANDLE hVhdObj,LPCSTR pDirName)    //Create directory.
{
	DWORD                    dwDirCluster                  = 0;
	CHAR                     DirName[MAX_FILE_NAME_LEN]    = {0};
	CHAR                     SubDirName[MAX_FILE_NAME_LEN] = {0};
	__FAT32_SHORTENTRY       DirShortEntry                 = {0};
	__FAT32_FS*              pFat32Fs                      = (__FAT32_FS*)hVhdObj;
	

	if((NULL == pFat32Fs) || (NULL == pDirName))
	{
		return FALSE;
	}

	if(!GetPathName((LPSTR)pDirName,DirName,SubDirName))
	{
		return FALSE;
	}

	//Try to open the parent directory.
	if(!GetDirEntry(pFat32Fs,DirName,&DirShortEntry,NULL,NULL))
	{	
		return FALSE;
	}

	if(!(DirShortEntry.FileAttributes & FILE_ATTR_DIRECTORY))  //Is not a directory.
	{
		return FALSE;
	}

	dwDirCluster = MAKELONG(DirShortEntry.wFirstClusLow,DirShortEntry.wFirstClusHi);

	return CreateFatDir(pFat32Fs,dwDirCluster,SubDirName,0);
}
開發者ID:AlexShiLucky,項目名稱:HelloX_OS,代碼行數:35,代碼來源:Fat32FileAccess.cpp

示例13: GetPathName

PathName
DviDoc::GetDocDir ()
{
  PathName result = GetPathName();
  result.RemoveFileSpec ();
  return (result);
}
開發者ID:bngabonziza,項目名稱:miktex,代碼行數:7,代碼來源:DviDoc.cpp

示例14: GetOwner

bool UPagedVolumeComponent::SetPagedVolume(UVoreealPagedVolume* NewVolume)
{
	if (NewVolume == Volume && NewVolume == nullptr)
		return false;

	AActor* Owner = GetOwner();
	if (!AreDynamicDataChangesAllowed() && Owner != NULL)
	{
		FMessageLog("PIE").Warning(FText::Format(
			FText::FromString(TEXT("Calling SetPagedVolume on '{0}' but Mobility is Static.")),
			FText::FromString(GetPathName())));
		return false;
	}

	Volume = NewVolume;

	// If there were a volume before we call then we force gc
	UWorld* World = GetWorld();
	if (World)
	{
		World->ForceGarbageCollection(true);
	}

	return true;
}
開發者ID:ChillyFlashER,項目名稱:Voreeal,代碼行數:25,代碼來源:VoreealPagedVolumeComponent.cpp

示例15: _T

BOOL CSkinButtonResource::LoadSkin(const TCHAR *skinfile, const CString& strControlType)
{
    static const TCHAR * ps = _T("Buttons");
    TCHAR buf[1000];
    CString path = GetPathName( skinfile );
	
	//wyw
	if (m_bInited)
	{
		m_bmpButton.DeleteObject();
	}

//    GetPrivateProfileString( ps, "Bitmap", "", buf, 1000, skinfile );
    GetPrivateProfileString( ps, strControlType, _T(""), buf, 1000, skinfile );
    if ( *buf == 0 || !m_bmpButton.LoadBitmap( path + _T("/")+ GetFileName( buf,1 )) )
        return FALSE;

    m_TopHeight = GetPrivateProfileInt( ps, _T("TopHeight"), 0, skinfile );
    m_BottomHeight = GetPrivateProfileInt( ps, _T("BottomHeight"), 0, skinfile );
    m_LeftWidth = GetPrivateProfileInt( ps, _T("LeftWidth"), 0, skinfile );
    m_RightWidth = GetPrivateProfileInt( ps, _T("RightWidth"), 0, skinfile );

    m_bTrans = GetPrivateProfileInt( ps, _T("Trans"), 0, skinfile );
    

    m_bInited = TRUE;
    return TRUE;
}
開發者ID:jiangchengxu,項目名稱:spreadtrum-w160,代碼行數:28,代碼來源:SkinButton.cpp


注:本文中的GetPathName函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。