2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Denis Mingulov
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2010-07-16 11:18:30 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-07-16 11:18:30 +02:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QObject>
|
2010-07-16 11:18:30 +02:00
|
|
|
|
|
|
|
|
#include "classviewparsertreeitem.h"
|
|
|
|
|
|
|
|
|
|
#include <cplusplus/CppDocument.h>
|
|
|
|
|
|
|
|
|
|
// might be changed to forward declaration - is not done to be less dependent
|
|
|
|
|
#include <projectexplorer/projectnodes.h>
|
|
|
|
|
#include <projectexplorer/project.h>
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QList>
|
|
|
|
|
#include <QSharedPointer>
|
|
|
|
|
#include <QStandardItem>
|
2011-07-06 17:40:54 +02:00
|
|
|
|
2010-07-16 11:18:30 +02:00
|
|
|
namespace ClassView {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2011-07-06 17:40:54 +02:00
|
|
|
class ParserPrivate;
|
|
|
|
|
|
2010-07-16 11:18:30 +02:00
|
|
|
class Parser : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2018-11-04 22:40:59 +01:00
|
|
|
explicit Parser(QObject *parent = nullptr);
|
|
|
|
|
~Parser() override;
|
2010-07-16 11:18:30 +02:00
|
|
|
|
|
|
|
|
void requestCurrentState();
|
|
|
|
|
void removeFiles(const QStringList &fileList);
|
2021-03-01 15:01:35 +01:00
|
|
|
void resetData(const QHash<Utils::FilePath, QPair<QString, Utils::FilePaths>> &projects);
|
|
|
|
|
void addProject(const Utils::FilePath &projectPath, const QString &projectName,
|
|
|
|
|
const Utils::FilePaths &filesInProject);
|
|
|
|
|
void removeProject(const Utils::FilePath &projectPath);
|
2010-07-16 11:18:30 +02:00
|
|
|
void setFlatMode(bool flat);
|
|
|
|
|
|
2021-03-01 15:01:35 +01:00
|
|
|
void updateDocuments(const QSet<Utils::FilePath> &documentPaths);
|
2021-02-18 15:02:54 +01:00
|
|
|
|
2021-02-08 12:22:21 +01:00
|
|
|
signals:
|
2021-02-16 14:01:16 +01:00
|
|
|
void treeRegenerated(const ParserTreeItem::ConstPtr &root);
|
2021-02-08 12:22:21 +01:00
|
|
|
|
|
|
|
|
private:
|
2021-03-01 15:01:35 +01:00
|
|
|
void updateDocumentsFromSnapshot(const QSet<Utils::FilePath> &documentPaths,
|
|
|
|
|
const CPlusPlus::Snapshot &snapshot);
|
2010-07-16 11:18:30 +02:00
|
|
|
|
|
|
|
|
ParserTreeItem::ConstPtr getParseDocumentTree(const CPlusPlus::Document::Ptr &doc);
|
|
|
|
|
ParserTreeItem::ConstPtr getCachedOrParseDocumentTree(const CPlusPlus::Document::Ptr &doc);
|
2021-03-01 15:01:35 +01:00
|
|
|
ParserTreeItem::ConstPtr getParseProjectTree(const Utils::FilePath &projectPath,
|
|
|
|
|
const QSet<Utils::FilePath> &filesInProject);
|
|
|
|
|
ParserTreeItem::ConstPtr getCachedOrParseProjectTree(const Utils::FilePath &projectPath,
|
|
|
|
|
const QSet<Utils::FilePath> &filesInProject);
|
2010-07-16 11:18:30 +02:00
|
|
|
ParserTreeItem::ConstPtr parse();
|
|
|
|
|
|
|
|
|
|
//! Private class data pointer
|
2011-07-06 17:40:54 +02:00
|
|
|
ParserPrivate *d;
|
2010-07-16 11:18:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ClassView
|