本文整理汇总了C++中CFileInfoW::IsDir方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileInfoW::IsDir方法的具体用法?C++ CFileInfoW::IsDir怎么用?C++ CFileInfoW::IsDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileInfoW
的用法示例。
在下文中一共展示了CFileInfoW::IsDir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsThereFolderOfPath
static bool IsThereFolderOfPath(const UString &path)
{
CFileInfoW fileInfo;
if (!FindFile(path, fileInfo))
return false;
return fileInfo.IsDir();
}
示例2: GetFolderSize
HRESULT GetFolderSize(const UString &path, UInt64 &numFolders, UInt64 &numFiles, UInt64 &size, IProgress *progress)
{
RINOK(progress->SetCompleted(NULL));
numFiles = numFolders = size = 0;
CEnumeratorW enumerator(path + UString(WSTRING_PATH_SEPARATOR L"*"));
CFileInfoW fileInfo;
while (enumerator.Next(fileInfo))
{
if (fileInfo.IsDir())
{
UInt64 subFolders, subFiles, subSize;
RINOK(GetFolderSize(path + UString(WCHAR_PATH_SEPARATOR) + fileInfo.Name, subFolders, subFiles, subSize, progress));
numFolders += subFolders;
numFolders++;
numFiles += subFiles;
size += subSize;
}
else
{
numFiles++;
size += fileInfo.Size;
}
}
return S_OK;
}
示例3: BindToPath
HRESULT CPanel::BindToPath(const UString &fullPath, bool &archiveIsOpened, bool &encrypted)
{
archiveIsOpened = false;
encrypted = false;
CDisableTimerProcessing disableTimerProcessing1(*this);
if (_parentFolders.Size() > 0)
{
const UString &virtPath = _parentFolders.Back().VirtualPath;
if (fullPath.Left(virtPath.Length()) == virtPath)
{
for (;;)
{
CMyComPtr<IFolderFolder> newFolder;
HRESULT res = _folder->BindToParentFolder(&newFolder);
if (!newFolder || res != S_OK)
break;
_folder = newFolder;
}
UStringVector parts;
SplitPathToParts(fullPath.Mid(virtPath.Length()), parts);
for (int i = 0; i < parts.Size(); i++)
{
const UString &s = parts[i];
if ((i == 0 || i == parts.Size() - 1) && s.IsEmpty())
continue;
CMyComPtr<IFolderFolder> newFolder;
HRESULT res = _folder->BindToFolder(s, &newFolder);
if (!newFolder || res != S_OK)
break;
_folder = newFolder;
}
return S_OK;
}
}
CloseOpenFolders();
UString sysPath = fullPath;
CFileInfoW fileInfo;
UStringVector reducedParts;
while (!sysPath.IsEmpty())
{
if (FindFile(sysPath, fileInfo))
break;
int pos = sysPath.ReverseFind(WCHAR_PATH_SEPARATOR);
if (pos < 0)
sysPath.Empty();
else
{
if (reducedParts.Size() > 0 || pos < sysPath.Length() - 1)
reducedParts.Add(sysPath.Mid(pos + 1));
sysPath = sysPath.Left(pos);
}
}
SetToRootFolder();
CMyComPtr<IFolderFolder> newFolder;
if (sysPath.IsEmpty())
{
if (_folder->BindToFolder(fullPath, &newFolder) == S_OK)
_folder = newFolder;
}
else if (fileInfo.IsDir())
{
NName::NormalizeDirPathPrefix(sysPath);
if (_folder->BindToFolder(sysPath, &newFolder) == S_OK)
_folder = newFolder;
}
else
{
UString dirPrefix;
if (!NDirectory::GetOnlyDirPrefix(sysPath, dirPrefix))
dirPrefix.Empty();
if (_folder->BindToFolder(dirPrefix, &newFolder) == S_OK)
{
_folder = newFolder;
LoadFullPath();
UString fileName;
if (NDirectory::GetOnlyName(sysPath, fileName))
{
HRESULT res =
OpenItemAsArchive(fileName, _currentFolderPrefix,
_currentFolderPrefix + fileName,
_currentFolderPrefix + fileName,
encrypted);
if (res != S_FALSE)
{
RINOK(res);
}
/*
if (res == E_ABORT)
return res;
*/
if (res == S_OK)
{
archiveIsOpened = true;
for (int i = reducedParts.Size() - 1; i >= 0; i--)
{
CMyComPtr<IFolderFolder> newFolder;
_folder->BindToFolder(reducedParts[i], &newFolder);
if (!newFolder)
//.........这里部分代码省略.........
示例4: DoesDirExist
bool DoesDirExist(LPCWSTR name)
{
CFileInfoW fi;
return fi.Find(name) && fi.IsDir();
}