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


C++ TranslationUnit::isIntact方法代码示例

本文整理汇总了C++中TranslationUnit::isIntact方法的典型用法代码示例。如果您正苦于以下问题:C++ TranslationUnit::isIntact方法的具体用法?C++ TranslationUnit::isIntact怎么用?C++ TranslationUnit::isIntact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TranslationUnit的用法示例。


在下文中一共展示了TranslationUnit::isIntact方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: isJobRequestOutDated

bool JobQueue::isJobRequestOutDated(const JobRequest &jobRequest) const
{
    const JobRequest::Requirements requirements = jobRequest.requirements;
    const UnsavedFiles unsavedFiles = m_translationUnits.unsavedFiles();

    if (requirements.testFlag(JobRequest::CurrentUnsavedFiles)) {
        if (jobRequest.unsavedFilesChangeTimePoint != unsavedFiles.lastChangeTimePoint()) {
            qCDebug(jobsLog) << "Removing due to outdated unsaved files:" << jobRequest;
            return true;
        }
    }

    bool projectCheckedAndItExists = false;

    if (requirements.testFlag(JobRequest::DocumentValid)) {
        if (!m_translationUnits.hasTranslationUnit(jobRequest.filePath, jobRequest.projectPartId)) {
            qCDebug(jobsLog) << "Removing due to already closed document:" << jobRequest;
            return true;
        }

        if (!m_projectParts.hasProjectPart(jobRequest.projectPartId)) {
            qCDebug(jobsLog) << "Removing due to already closed project:" << jobRequest;
            return true;
        }
        projectCheckedAndItExists = true;

        const TranslationUnit translationUnit
                = m_translationUnits.translationUnit(jobRequest.filePath, jobRequest.projectPartId);
        if (!translationUnit.isIntact()) {
            qCDebug(jobsLog) << "Removing due to not intact translation unit:" << jobRequest;
            return true;
        }

        if (requirements.testFlag(JobRequest::CurrentDocumentRevision)) {
            if (translationUnit.documentRevision() != jobRequest.documentRevision) {
                qCDebug(jobsLog) << "Removing due to changed document revision:" << jobRequest;
                return true;
            }
        }
    }

    if (requirements.testFlag(JobRequest::CurrentProject)) {
        if (!projectCheckedAndItExists && !m_projectParts.hasProjectPart(jobRequest.projectPartId)) {
            qCDebug(jobsLog) << "Removing due to already closed project:" << jobRequest;
            return true;
        }

        const ProjectPart &project = m_projectParts.project(jobRequest.projectPartId);
        if (project.lastChangeTimePoint() != jobRequest.projectChangeTimePoint) {
            qCDebug(jobsLog) << "Removing due to outdated project:" << jobRequest;
            return true;
        }
    }

    return false;
}
开发者ID:qrsrjm,项目名称:qt-creator,代码行数:56,代码来源:clangjobqueue.cpp


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