当前位置: 首页>>代码示例>>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;未经允许,请勿转载。