本文整理汇总了C++中FileList::AddExcludeList方法的典型用法代码示例。如果您正苦于以下问题:C++ FileList::AddExcludeList方法的具体用法?C++ FileList::AddExcludeList怎么用?C++ FileList::AddExcludeList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileList
的用法示例。
在下文中一共展示了FileList::AddExcludeList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dir
void TestFileList::filterFiles4()
{
FileList list;
QStringList filters;
filters << "dir1/";
list.AddExcludeList(filters);
list.AddDirectory(QString(SRCDIR) + "/../data/files", true);
QStringList files = list.GetFileList();
QCOMPARE(files.size(), 8);
QDir dir(QString(SRCDIR) + "/../data/files");
QString base = dir.canonicalPath();
QVERIFY(! files.contains(base + "/dir1/foo1.cpp"));
QVERIFY(! files.contains(base + "/dir1/dir11/foo11.cpp"));
}
示例2: DoCheckFiles
void MainWindow::DoCheckFiles(const QStringList &files)
{
if (files.isEmpty()) {
return;
}
ClearResults();
FileList pathList;
pathList.AddPathList(files);
if (mProject)
pathList.AddExcludeList(mProject->GetProjectFile()->GetExcludedPaths());
QStringList fileNames = pathList.GetFileList();
mUI.mResults->Clear();
mThread->ClearFiles();
if (fileNames.isEmpty()) {
QMessageBox msg(QMessageBox::Warning,
tr("Cppcheck"),
tr("No suitable files found to check!"),
QMessageBox::Ok,
this);
msg.exec();
return;
}
mUI.mResults->CheckingStarted(fileNames.count());
mThread->SetFiles(fileNames);
QDir inf(mCurrentDirectory);
const QString checkPath = inf.canonicalPath();
mSettings->setValue(SETTINGS_CHECK_PATH, checkPath);
CheckLockDownUI(); // lock UI while checking
mUI.mResults->SetCheckDirectory(checkPath);
Settings checkSettings = GetCppcheckSettings();
if (mProject)
qDebug() << "Checking project file" << mProject->GetProjectFile()->GetFilename();
mThread->Check(checkSettings, false);
}
示例3: filterFiles
void TestFileList::filterFiles()
{
FileList list;
QStringList filters;
filters << "foo1.cpp" << "foo3.cc";
list.AddExcludeList(filters);
list.AddFile(QString(SRCDIR) + "/../data/files/foo1.cpp");
list.AddFile(QString(SRCDIR) + "/../data/files/foo2.cxx");
list.AddFile(QString(SRCDIR) + "/../data/files/foo3.cc");
list.AddFile(QString(SRCDIR) + "/../data/files/foo4.c");
list.AddFile(QString(SRCDIR) + "/../data/files/foo5.c++");
list.AddFile(QString(SRCDIR) + "/../data/files/foo6.txx");
list.AddFile(QString(SRCDIR) + "/../data/files/foo7.tpp");
QStringList files = list.GetFileList();
QCOMPARE(files.size(), 5);
QDir dir(QString(SRCDIR) + "/../data/files");
QString base = dir.canonicalPath();
QVERIFY(! files.contains(base + "/foo1.cpp"));
QVERIFY(! files.contains(base + "/foo3.cpp"));
}