本文整理汇总了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;
}