本文整理汇总了C++中TDirectory::GetFile方法的典型用法代码示例。如果您正苦于以下问题:C++ TDirectory::GetFile方法的具体用法?C++ TDirectory::GetFile怎么用?C++ TDirectory::GetFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TDirectory
的用法示例。
在下文中一共展示了TDirectory::GetFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoCompareDirectories
void TDirectoryDiffDocument::DoCompareDirectories(TDirectory& directory1, TDirectory& directory2)
{
directory1.Open();
directory2.Open();
// iterate through directory 1
int count = directory1.GetFileCount();
for (int i = 0; i < count; i++)
{
TString name;
bool isDirectory;
directory1.GetFile(i, name, isDirectory);
if (isDirectory)
{
// ignore CVS, subversion and directories
if (Tstrcmp(name, "CVS") != 0 && Tstrcmp(name, ".svn") != 0 && Tstrcmp(name, ".git") != 0)
{
TDirectory subDir2(directory2, name);
if (subDir2.Exists())
{
TDirectory subDir1(directory1, name);
DoCompareDirectories(subDir1, subDir2);
}
}
}
else
{
TFile file2(directory2, name);
if (file2.Exists())
{
TFile file1(directory1, name);
// ignore class files and compiled python files
const char* extension = file1.GetFileExtension();
if (Tstrcmp(extension, "class") != 0 && Tstrcmp(extension, "pyc") != 0)
{
if (!TFile::FilesAreEqual(file1, file2, true))
{
TString* path = new TString;;
TFile::ComputeRelativePath(file1.GetPath(), fDirectory1.GetPath(), *path);
fDiffList.InsertLast(path);
}
}
}
}
}
directory1.Close();
directory2.Close();
}