本文整理汇总了C++中CFileFind::GetFileTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileFind::GetFileTitle方法的具体用法?C++ CFileFind::GetFileTitle怎么用?C++ CFileFind::GetFileTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileFind
的用法示例。
在下文中一共展示了CFileFind::GetFileTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindExtensions
void InformApp::FindExtensions(void)
{
m_extensions.clear();
for (int i = 0; i < 2; i++)
{
CString path;
switch (i)
{
case 0:
path.Format("%s\\Internal\\Extensions\\*.*",(LPCSTR)GetAppDir());
break;
case 1:
path.Format("%s\\Inform\\Extensions\\*.*",(LPCSTR)GetHomeDir());
break;
default:
ASSERT(FALSE);
break;
}
CFileFind find;
BOOL finding = find.FindFile(path);
while (finding)
{
finding = find.FindNextFile();
if (!find.IsDots() && find.IsDirectory())
{
CString author = find.GetFileName();
if (author == "Reserved")
continue;
if ((author.GetLength() > 0) && (author.GetAt(0) == '.'))
continue;
path.Format("%s\\*.*",(LPCSTR)find.GetFilePath());
CFileFind find;
BOOL finding = find.FindFile(path);
while (finding)
{
finding = find.FindNextFile();
if (!find.IsDirectory())
{
CString ext = ::PathFindExtension(find.GetFilePath());
if (ext.CompareNoCase(".i7x") == 0)
m_extensions.push_back(ExtLocation(author,find.GetFileTitle(),(i == 0),find.GetFilePath()));
else if (ext.IsEmpty() && (i == 1))
{
// Rename an old-style extension (with no file extension) to end with ".i7x"
CString newPath = find.GetFilePath();
newPath.Append(".i7x");
if (::MoveFile(find.GetFilePath(),newPath))
m_extensions.push_back(ExtLocation(author,find.GetFileTitle(),(i == 0),newPath));
}
}
}
find.Close();
}
}
find.Close();
}
std::sort(m_extensions.begin(),m_extensions.end());
}
示例2: FillLanguages
void COptionsGeneral::FillLanguages()
{
CString csFile = CGetSetOptions::GetPath(PATH_LANGUAGE);
csFile += "*.xml";
CString csLanguage = CGetSetOptions::GetLanguageFile();
CFileFind find;
BOOL bCont = find.FindFile(csFile);
int nEnglishIndex = NO_MATCH;
while(bCont)
{
bCont = find.FindNextFile();
int nIndex = m_cbLanguage.AddString(find.GetFileTitle());
if(find.GetFileTitle() == csLanguage)
{
nEnglishIndex = -1;
m_cbLanguage.SetCurSel(nIndex);
}
else if(find.GetFileTitle() == _T("English"))
{
if(nEnglishIndex == NO_MATCH)
nEnglishIndex = nIndex;
}
}
if(nEnglishIndex >= 0)
{
m_cbLanguage.SetCurSel(nEnglishIndex);
}
}
示例3: GetFileNameArray
void CTaiKlineDlgHistorySelect::GetFileNameArray(CStringArray &sArry)
{
CString sPath = "data\\historysh\\";
CFileFind finder;
int n = 0;
BOOL bWorking = finder.FindFile(sPath+"*.hst");
while(bWorking)
{
bWorking = finder.FindNextFile();
CString filename = finder.GetFileTitle();
int nSize = sArry.GetSize ();
for(int j=0;j<nSize;j++)
{
if(filename <sArry[j])
{
sArry.InsertAt (j,filename);
break;
}
if(j==nSize-1)
sArry.Add (filename);
}
if(nSize == 0)
sArry.Add (filename);
n++;
}
sPath = "data\\historysz\\";
n = 0;
bWorking = finder.FindFile(sPath+"*.hst");
while(bWorking)
{
bWorking = finder.FindNextFile();
CString filename = finder.GetFileTitle();
int nSize = sArry.GetSize ();
BOOL bf;
bf=false;
for(int j=0;j<nSize;j++)
{
if(filename ==sArry[j])
{
bf=true;
break;
}
else
{
bf=false;
continue;
}
if(j==nSize-1)
sArry.Add (filename);
}
if((nSize == 0)||(!bf))
sArry.Add (filename);
n++;
}
}
示例4: ShowDB
void ShowDB()
{
CFileFind finder;
int iRowN = 0;
int iNameLen = 0,iTemp = 0;
std::cout<<"These are the databases !\n";
int bWorking = finder.FindFile("..\\Data\\*.*");
std::cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<'\n';//<---计32个字符
std::cout<<"| Database |"<<'\n';
std::cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<'\n';//<---计32个字符
while(bWorking)
{
bWorking = finder.FindNextFile();
if (finder.IsDots())
continue;
if (finder.IsDirectory())
{
iRowN++;
CString str = finder.GetFileTitle();
iNameLen = str.GetLength();
std::cout <<"| "<< (LPCTSTR) str;
for(iTemp = 29 - iNameLen;iTemp != 0;iTemp--)
std::cout<<' ';
std::cout <<"|"<<'\n';
}
}
std::cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<'\n';//<---计32个字符
std::cout<<"There are" <<iRowN<<" rows in the database!";
finder.Close();
}
示例5: GetDirectoryContain
void YpDirectory::GetDirectoryContain(vector<CString>& list)
{
CFileFind ff;
CString szDir = path;
if(szDir.Right(1) != "\\")
{
szDir += "\\";
}
szDir += "*.*";
BOOL res = ff.FindFile(szDir);
const CString each = "{%s|%d|%s}";
while(res)
{
res = ff.FindNextFile();
CString temp;
if (ff.IsDirectory() && !ff.IsDots())
{
temp.Format(each, ff.GetFileName(), 0, "Ŀ¼");
list.push_back(temp);
}
else if(!ff.IsDirectory() && !ff.IsDots())
{
CFileStatus status;
CString path = ff.GetFilePath();
CFile::GetStatus(path, status);
temp.Format(each, ff.GetFileName(), (UINT)(status.m_size / 1024.0), ff.GetFileTitle());
list.push_back(temp);
}
}
ff.Close();
}
示例6: UpdataFolderStatus
void CDlgArmLogICImage::UpdataFolderStatus()
{
// Get the folder name
m_Folder.RemoveAll();
CString csFilePath = _T("");
csFilePath = m.FilePath.ArmLogICImagePath;
CFileFind finder; //建立搜尋用的CFileFind物件
BOOL bResult = finder.FindFile( csFilePath + "*.*" ); //尋找第一個檔案
while(bResult)
{
bResult = finder.FindNextFile(); //尋找下一個檔案
if(!finder.IsDots() && finder.IsDirectory())
{
CString csFileDirectory = _T("");
csFileDirectory.Format("%s", finder.GetFileTitle() );
m_Folder.Add( csFileDirectory );
}
}
m_listFolderStatus.ResetContent();
int iSize = m_Folder.GetSize();
for(int i=0;i<iSize;i++)
{
CString csFolderName = _T("");
csFolderName = m_Folder.GetAt(i);
m_listFolderStatus.AddString( csFolderName );
}
CString csFolderCounter = _T("");
csFolderCounter.Format("Folder Counter: %d", iSize );
m_wndlistFolderCounter.SetWindowText( csFolderCounter );
}
示例7: OnUpdate
//////////////////////////////////////////////////////////////
//功能:同步图库与显示内容
//////////////////////////////////////////////////////////////
void CModuleWnd::OnUpdate()
{
GetListCtrl()->DeleteAllItems();
CString strName;
if (m_pCurrentDocument == NULL) //显示库目录
{
strName = CModuleDoc::GetDefaultPath() + _T("\\*.");
strName += CModuleDoc::m_szModuleLibFileExt;
CFileFind finder;
BOOL bOk = finder.FindFile(strName);
while(bOk)
{
bOk = finder.FindNextFile();
strName = finder.GetFileTitle();
GetListCtrl()->InsertItem(1, strName, MLW_ICON_FOLDER);
}
}
else //显示库内容
{
int nCount = m_pCurrentDocument->GetModuleCount();
for (int i = 0; i < nCount; i++)
{
CModuleDoc::CModule* pModule = m_pCurrentDocument->GetModule(i);
GetListCtrl()->InsertItem(i, pModule->m_strName, i);
}
}
}
示例8: ScanLang
UINT CLang::ScanLang(CString dirPath)
{
CString langName;
CString fileName;
BOOL bFound;
UINT pos;
CFileFind cFF;
bFound = cFF.FindFile(dirPath+"\\*.txt");
if(bFound)
{
do
{
bFound = cFF.FindNextFile();//查下一个
fileName = cFF.GetFileTitle();//
if(fileName != _T("中文") && fileName != _T("English"))//不等时
{
pos = fileName.Find('.');//
langName = fileName.Left(pos);//
m_langName[m_langCount] = fileName;//
m_langCount++;
}
}
while(bFound);//
}
else
{
return 0;
}
return m_langCount-2;//
}
示例9: Initialize
void SpellCheck::Initialize(void)
{
if (spell != NULL)
return;
// Get long and short names for all possible dictionaries
::EnumSystemLocales(HandleLocale,LCID_SUPPORTED);
// Set up the installed dictionaries
CFileFind find;
BOOL found = find.FindFile(theApp.GetAppDir()+"\\Dictionaries\\*.dic");
while (found)
{
found = find.FindNextFile();
std::map<std::string,std::string>::const_iterator it = allLanguages.find((LPCSTR)find.GetFileTitle());
if (it != allLanguages.end())
languages.insert(std::make_pair(it->second,it->first));
}
// Load registry settings
char fileName[MAX_PATH] = "";
CRegKey registryKey;
if (registryKey.Open(HKEY_CURRENT_USER,"Software\\David Kinder\\Inform\\Spelling",KEY_READ) == ERROR_SUCCESS)
{
ULONG len = sizeof fileName;
if (registryKey.QueryStringValue("Language",fileName,&len) != ERROR_SUCCESS)
strcpy(fileName,"");
}
// As the default, use the UK English dictionary for UK English, otherwise US English
if (fileName[0] == '\0')
{
switch (::GetUserDefaultLangID())
{
case MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_UK):
strcpy(fileName,"en_GB");
break;
default:
strcpy(fileName,"en_US");
break;
}
}
// Select an initial current language
currentLanguage = languages.begin();
for (StrPairSet::iterator it = languages.begin(); it != languages.end(); ++it)
{
if (it->second == fileName)
currentLanguage = it;
}
InitSpellObject();
}
示例10: GetNameListOfDir
/**
desc: 获取某文件夹下的文件全路径名
strPath: 文件夹路径
strarrFileList: 保存文件列表的字符串数组
return: 返回 当前程序所在路径
*/
int CommonStrMethod::GetNameListOfDir(CString strPath, CStringArray& strarrFileList)
{
CFileFind finder;
BOOL bFound = finder.FindFile(strPath);
int nCount = 0;
for(; bFound; nCount++)
{
bFound = finder.FindNextFile();
strarrFileList.Add(finder.GetFileTitle());
}
finder.Close();
return nCount;
}
示例11: OnInitDialog
BOOL CMultiplay::OnInitDialog()
{
CDialog::OnInitDialog();
if (!theApp.recording_ && theApp.mac_.size() > 0)
name_ctrl_.AddString(DEFAULT_MACRO_NAME);
// Find all .hem files in macro dir
CFileFind ff;
ASSERT(theApp.mac_dir_.Right(1) == "\\");
BOOL bContinue = ff.FindFile(theApp.mac_dir_ + "*.hem");
while (bContinue)
{
// At least one match - check them all
bContinue = ff.FindNextFile();
// Hide macro files beginning with underscore unless recording.
// This is so that "sub-macros" are not normally seen but can be
// selected when recording a macro that invokes them.
if (theApp.recording_ || ff.GetFileTitle().Left(1) != "_")
name_ctrl_.AddString(ff.GetFileTitle());
}
ASSERT(name_ctrl_.GetCount() > 0);
name_ctrl_.SetCurSel(0);
ASSERT(GetDlgItem(IDC_SPIN_PLAYS) != NULL);
((CSpinButtonCtrl *)GetDlgItem(IDC_SPIN_PLAYS))->SetRange(1, UD_MAXVAL);
ASSERT(GetDlgItem(IDC_PLAYS) != NULL);
ASSERT(GetDlgItem(IDC_DESC_PLAYS) != NULL);
ASSERT(GetDlgItem(IDC_SPIN_PLAYS) != NULL);
GetDlgItem(IDC_PLAYS)->EnableWindow(!theApp.recording_);
GetDlgItem(IDC_DESC_PLAYS)->EnableWindow(!theApp.recording_);
GetDlgItem(IDC_SPIN_PLAYS)->EnableWindow(!theApp.recording_);
FixControls();
return TRUE;
}
示例12: GetFirstStrategyPosition
CString CStkUIApp::GetNextNewStrategyTitle( CString & strExtBuffer, CString strPath )
{
CString string;
VERIFY( string.LoadString( IDS_STRATEGY_NONAME ) );
CString strExt = AfxGetStrategyFileExt( );
if( !strExt.IsEmpty())
strExtBuffer = strExt;
CStringArray astrExistTitle;
POSITION pos = GetFirstStrategyPosition();
while( NULL != pos )
{
CStrategy * pStrategy = GetNextStrategy( pos );
astrExistTitle.Add( AfxGetFileTitleNoExt(pStrategy->GetPathName()) );
}
CFileFind finder;
BOOL bWorking = finder.FindFile( AfxGetFilePath( (LPCTSTR)strPath, LPCTSTR("*" + strExt) ) );
while( bWorking )
{
bWorking = finder.FindNextFile();
astrExistTitle.Add( finder.GetFileTitle( ) );
}
finder.Close();
for( int i=1; ; i++ )
{
CString strTemp;
strTemp.Format( "%s(%d)", string, i );
BOOL bHas = FALSE;
for( int k=0; k<astrExistTitle.GetSize(); k++ )
{
if( 0 == strTemp.CompareNoCase( astrExistTitle.ElementAt(k) ) )
{
bHas = TRUE;
break;
}
}
if( !bHas )
{
string = strTemp;
break;
}
}
return string;
}
示例13: FillBox
void CSelectVectorDlg::FillBox()
{
CFileFind vectordir;
char chpath[MAX_PATH];
GetModuleFileName(NULL,(LPSTR)chpath,sizeof(chpath));
CString file;//=theApp.GetDirectory();
file.Format("%s",chpath);
CString vectorname;
file+="global\\vec\\*.vec";
m_list.ResetContent();
if (vectordir.FindFile(file))
{
while (vectordir.FindNextFile())
{
vectorname=vectordir.GetFileTitle();
m_list.AddString(vectorname);
}
vectorname=vectordir.GetFileTitle();
m_list.AddString(vectorname);
vectordir.Close();
}
}
示例14:
_declspec(dllexport) void morph::loadAllModels(LPTSTR directoryPath,
std::vector<std::vector<morphPoint>*> *landMarkSets,
std::vector<std::vector<morphPoint>*> *densePointsSets)
{
for(int i=0; i<landMarkSets->size(); i++)
{
delete landMarkSets->at(i);
}
landMarkSets->clear();
for(int i=0; i<densePointsSets->size();i++)
{
delete densePointsSets->at(i);
}
densePointsSets->clear();
CString allFilePath;
allFilePath.Append(directoryPath);
allFilePath.Append(_T("*.pp"));
CFileFind ppFinder;
bool isAny=ppFinder.FindFile(allFilePath.GetBuffer(0));
int num=0;
while(isAny!=0)
{
isAny=ppFinder.FindNextFile();
num++;
std::vector<morphPoint> *vec=new std::vector<morphPoint>();
readControlPointsFromPP((*vec), ppFinder.GetFilePath().GetBuffer(0));
landMarkSets->push_back(vec);
CString plyFilePath;
plyFilePath.Append(directoryPath);
plyFilePath.Append(_T("RegisteredFaces\\"));
plyFilePath.Append(ppFinder.GetFileTitle());
plyFilePath.Append(_T("_registered"));
plyFilePath.Append(_T(".ply"));
std::vector<morphPoint> *model=new std::vector<morphPoint>();
readDensePointsFromPLY((*model),plyFilePath.GetBuffer(0));
densePointsSets->push_back(model);
}
}
示例15: ShowTable
void ShowTable()
{
CFileFind finder;
int iRowN = 0;
char loc[256];
CString Dbn(CurDB);
int iNameLen = 0,iTemp = 0;
std::cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<'\n';
std::cout<<"| Tables in ";
std::cout << (LPCTSTR) Dbn;
int strNum = Dbn.GetLength();
for(iTemp = 19 - iNameLen-strNum;iTemp != 0;iTemp--)
std::cout<<' ';
std::cout <<"|"<<'\n';
std::cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<'\n';
strcpy(loc,CurLocation);
strcat(loc,"*.dbf");
int bWorking = finder.FindFile(loc);
while(bWorking)
{
bWorking = finder.FindNextFile();
if (finder.IsDots())
continue;
iRowN++;
CString str = finder.GetFileTitle();
iNameLen = str.GetLength();
std::cout <<"| "<< (LPCTSTR) str;
for(iTemp = 29 - iNameLen;iTemp != 0;iTemp--)
std::cout<<' ';
std::cout <<"|"<<'\n';
}
std::cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<'\n';
std::cout<<"There are" <<iRowN<<" rows in the table!";
finder.Close();
}