当前位置: 首页>>代码示例>>C++>>正文


C++ FileList::AddPathList方法代码示例

本文整理汇总了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);
}
开发者ID:0x20e,项目名称:cppcheck,代码行数:16,代码来源:testfilelist.cpp

示例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);
}
开发者ID:zblair,项目名称:cppcheck,代码行数:45,代码来源:mainwindow.cpp

示例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);
}
开发者ID:rgeissert,项目名称:cppcheck,代码行数:42,代码来源:mainwindow.cpp

示例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;
    }
开发者ID:NightOfTwelve,项目名称:cppcheck,代码行数:22,代码来源:selectfilesdialog.cpp


注:本文中的FileList::AddPathList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。