From d8eb5ddb757744300fcaf498c39086ac8d62bcd5 Mon Sep 17 00:00:00 2001 From: Sergey Shambir <sergey.shambir.auto@gmail.com> Date: Sun, 26 May 2013 10:57:41 +0400 Subject: [PATCH] CppTools: cleanup CppPreprocessor header, added short docs. Change-Id: Ib61197da939165d24b99e40f29f9de13d109e044 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com> --- src/plugins/cpptools/cpppreprocessor.cpp | 12 ++++++++++++ src/plugins/cpptools/cpppreprocessor.h | 9 +++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/plugins/cpptools/cpppreprocessor.cpp b/src/plugins/cpptools/cpppreprocessor.cpp index 5c5d1bd803f..d12b56b207a 100644 --- a/src/plugins/cpptools/cpppreprocessor.cpp +++ b/src/plugins/cpptools/cpppreprocessor.cpp @@ -5,6 +5,18 @@ #include <QCoreApplication> +/*! + * \class CppTools::Internal::CppPreprocessor + * \brief The CppPreprocessor class updates set of indexed C++ files. + * + * Indexed file is truncated version of fully parsed document: copy of source + * code and full AST will be dropped when indexing is done. Working copy ensures + * that documents with most recent copy placed in memory will be parsed correctly. + * + * \sa CPlusPlus::Document + * \sa CppTools::CppModelManagerInterface::WorkingCopy + */ + using namespace CPlusPlus; using namespace CppTools; using namespace CppTools::Internal; diff --git a/src/plugins/cpptools/cpppreprocessor.h b/src/plugins/cpptools/cpppreprocessor.h index d931a880c4b..c54bbefb302 100644 --- a/src/plugins/cpptools/cpppreprocessor.h +++ b/src/plugins/cpptools/cpppreprocessor.h @@ -14,11 +14,14 @@ namespace Internal { class CppModelManager; +// Documentation inside. class CPPTOOLS_EXPORT CppPreprocessor: public CPlusPlus::Client { Q_DISABLE_COPY(CppPreprocessor) public: + static QString cleanPath(const QString &path); + CppPreprocessor(QPointer<CppModelManager> modelManager, bool dumpFileNameWhileParsing = false); virtual ~CppPreprocessor(); @@ -26,15 +29,11 @@ public: void setWorkingCopy(const CppTools::CppModelManagerInterface::WorkingCopy &workingCopy); void setIncludePaths(const QStringList &includePaths); void setFrameworkPaths(const QStringList &frameworkPaths); - void addFrameworkPath(const QString &frameworkPath); - void setProjectFiles(const QStringList &files); void setTodo(const QStringList &files); void run(const QString &fileName); void removeFromCache(const QString &fileName); - void resetEnvironment(); - static QString cleanPath(const QString &path); const QSet<QString> &todo() const { return m_todo; } @@ -69,6 +68,8 @@ protected: virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType type); private: + void addFrameworkPath(const QString &frameworkPath); + CPlusPlus::Snapshot m_snapshot; QPointer<CppModelManager> m_modelManager; bool m_dumpFileNameWhileParsing; -- GitLab