本文整理汇总了C++中CFileFind::IsTemporary方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileFind::IsTemporary方法的具体用法?C++ CFileFind::IsTemporary怎么用?C++ CFileFind::IsTemporary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileFind
的用法示例。
在下文中一共展示了CFileFind::IsTemporary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnApply
BOOL CPPgDirectories::OnApply()
{
bool testtempdirchanged=false;
CString testincdirchanged = thePrefs.GetMuleDirectory(EMULE_INCOMINGDIR);
CString strIncomingDir;
GetDlgItemText(IDC_INCFILES, strIncomingDir);
MakeFoldername(strIncomingDir);
if (strIncomingDir.IsEmpty()){
strIncomingDir = thePrefs.GetDefaultDirectory(EMULE_INCOMINGDIR, true); // will create the directory here if it doesnt exists
SetDlgItemText(IDC_INCFILES, strIncomingDir);
}
else if (thePrefs.IsInstallationDirectory(strIncomingDir)){
AfxMessageBox(GetResString(IDS_WRN_INCFILE_RESERVED));
return FALSE;
}
else if (strIncomingDir.CompareNoCase(testincdirchanged) != 0 && strIncomingDir.CompareNoCase(thePrefs.GetDefaultDirectory(EMULE_INCOMINGDIR, false)) != 0){
// if the user chooses a non-default directory which already contains files, inform him that all those files
// will be shared
CFileFind ff;
CString strSearchPath;
strSearchPath.Format(_T("%s\\*"),strIncomingDir);
bool bEnd = !ff.FindFile(strSearchPath, 0);
bool bExistingFile = false;
while (!bEnd)
{
bEnd = !ff.FindNextFile();
if (ff.IsDirectory() || ff.IsDots() || ff.IsSystem() || ff.IsTemporary() || ff.GetLength()==0 || ff.GetLength()>MAX_EMULE_FILE_SIZE)
continue;
// ignore real LNK files
TCHAR szExt[_MAX_EXT];
_tsplitpath(ff.GetFileName(), NULL, NULL, NULL, szExt);
if (_tcsicmp(szExt, _T(".lnk")) == 0){
SHFILEINFO info;
if (SHGetFileInfo(ff.GetFilePath(), 0, &info, sizeof(info), SHGFI_ATTRIBUTES) && (info.dwAttributes & SFGAO_LINK)){
if (!thePrefs.GetResolveSharedShellLinks())
continue;
}
}
// ignore real THUMBS.DB files -- seems that lot of ppl have 'thumbs.db' files without the 'System' file attribute
if (ff.GetFileName().CompareNoCase(_T("thumbs.db")) == 0)
continue;
bExistingFile = true;
break;
}
if (bExistingFile
&& AfxMessageBox(GetResString(IDS_WRN_INCFILE_EXISTS), MB_OKCANCEL | MB_ICONINFORMATION) == IDCANCEL)
{
return FALSE;
}
}
// checking specified tempdir(s)
CString strTempDir;
GetDlgItemText(IDC_TEMPFILES, strTempDir);
if (strTempDir.IsEmpty()){
strTempDir = thePrefs.GetDefaultDirectory(EMULE_TEMPDIR, true); // will create the directory here if it doesnt exists
SetDlgItemText(IDC_TEMPFILES, strTempDir);
}
int curPos=0;
CStringArray temptempfolders;
CString atmp=strTempDir.Tokenize(_T("|"), curPos);
while (!atmp.IsEmpty())
{
atmp.Trim();
if (!atmp.IsEmpty()) {
if (CompareDirectories(strIncomingDir, atmp)==0){
AfxMessageBox(GetResString(IDS_WRN_INCTEMP_SAME));
return FALSE;
}
if (thePrefs.IsInstallationDirectory(atmp)){
AfxMessageBox(GetResString(IDS_WRN_TEMPFILES_RESERVED));
return FALSE;
}
bool doubled=false;
for (int i=0;i<temptempfolders.GetCount();i++) // avoid double tempdirs
if (temptempfolders.GetAt(i).CompareNoCase(atmp)==0) {
doubled=true;
break;
}
if (!doubled) {
temptempfolders.Add(atmp);
if (thePrefs.tempdir.GetCount()>=temptempfolders.GetCount()) {
if( atmp.CompareNoCase(thePrefs.GetTempDir(temptempfolders.GetCount()-1))!=0 )
testtempdirchanged=true;
} else testtempdirchanged=true;
}
}
atmp = strTempDir.Tokenize(_T("|"), curPos);
}
if (temptempfolders.IsEmpty())
temptempfolders.Add(strTempDir = thePrefs.GetDefaultDirectory(EMULE_TEMPDIR, true));
if (temptempfolders.GetCount()!=thePrefs.tempdir.GetCount())
//.........这里部分代码省略.........