本文整理汇总了C++中FileList::AddPathList方法的典型用法代码示例。如果您正苦于以下问题:C++ FileList::AddPathList方法的具体用法?C++ FileList::AddPathList怎么用?C++ FileList::AddPathList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileList
的用法示例。
在下文中一共展示了FileList::AddPathList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addPathList
void TestFileList::addPathList()
{
// Accepted extensions: *.cpp, *.cxx, *.cc, *.c, *.c++, *.txx, *.tpp"
QStringList paths;
paths << QString(SRCDIR) + "/../data/files/foo1.cpp";
paths << QString(SRCDIR) + "/../data/files/foo2.cxx";
paths << QString(SRCDIR) + "/../data/files/foo3.cc";
paths << QString(SRCDIR) + "/../data/files/foo4.c";
paths << QString(SRCDIR) + "/../data/files/foo5.c++";
paths << QString(SRCDIR) + "/../data/files/foo6.txx";
paths << QString(SRCDIR) + "/../data/files/foo7.tpp";
FileList list;
list.AddPathList(paths);
QStringList files = list.GetFileList();
QCOMPARE(files.size(), 7);
}
示例2: DoCheckFiles
void MainWindow::DoCheckFiles(const QStringList &files)
{
if (files.isEmpty())
{
return;
}
ClearResults();
FileList pathList;
pathList.AddPathList(files);
if (mProject)
pathList.AddIngoreList(mProject->GetProjectFile()->GetIgnoredPaths());
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: DoCheckFiles
void MainWindow::DoCheckFiles(const QStringList &files)
{
if (files.isEmpty())
{
return;
}
ClearResults();
FileList pathList;
pathList.AddPathList(files);
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);
EnableCheckButtons(false);
mUI.mActionSettings->setEnabled(false);
mUI.mActionOpenXML->setEnabled(false);
mUI.mResults->SetCheckDirectory(checkPath);
Settings checkSettings = GetCppcheckSettings();
EnableProjectActions(false);
EnableProjectOpenActions(false);
mThread->Check(checkSettings, false);
}
示例4: getFiles
QStringList getFiles() const {
QStringList ret;
// List all files in "checked" folders..
FileList fileLister;
fileLister.AddPathList(checked);
ret = fileLister.GetFileList();
// Remove all items from ret that are unchecked but not checked..
for (int i = ret.size() - 1; i >= 0; i--) {
int uncheckindex = getindex(unchecked, ret[i]);
if (uncheckindex == -1)
continue;
// both checked and unchecked, check which to rely on
int checkindex = getindex(checked, ret[i]);
if (checked[checkindex].size() < unchecked[uncheckindex].size())
ret.removeAt(i);
}
return ret;
}