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>
This commit is contained in:
Sergey Shambir
2013-05-26 10:57:41 +04:00
committed by hjk
parent 2d68f9c808
commit d8eb5ddb75
2 changed files with 17 additions and 4 deletions

View File

@@ -5,6 +5,18 @@
#include <QCoreApplication> #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 CPlusPlus;
using namespace CppTools; using namespace CppTools;
using namespace CppTools::Internal; using namespace CppTools::Internal;

View File

@@ -14,11 +14,14 @@ namespace Internal {
class CppModelManager; class CppModelManager;
// Documentation inside.
class CPPTOOLS_EXPORT CppPreprocessor: public CPlusPlus::Client class CPPTOOLS_EXPORT CppPreprocessor: public CPlusPlus::Client
{ {
Q_DISABLE_COPY(CppPreprocessor) Q_DISABLE_COPY(CppPreprocessor)
public: public:
static QString cleanPath(const QString &path);
CppPreprocessor(QPointer<CppModelManager> modelManager, bool dumpFileNameWhileParsing = false); CppPreprocessor(QPointer<CppModelManager> modelManager, bool dumpFileNameWhileParsing = false);
virtual ~CppPreprocessor(); virtual ~CppPreprocessor();
@@ -26,15 +29,11 @@ public:
void setWorkingCopy(const CppTools::CppModelManagerInterface::WorkingCopy &workingCopy); void setWorkingCopy(const CppTools::CppModelManagerInterface::WorkingCopy &workingCopy);
void setIncludePaths(const QStringList &includePaths); void setIncludePaths(const QStringList &includePaths);
void setFrameworkPaths(const QStringList &frameworkPaths); void setFrameworkPaths(const QStringList &frameworkPaths);
void addFrameworkPath(const QString &frameworkPath);
void setProjectFiles(const QStringList &files);
void setTodo(const QStringList &files); void setTodo(const QStringList &files);
void run(const QString &fileName); void run(const QString &fileName);
void removeFromCache(const QString &fileName); void removeFromCache(const QString &fileName);
void resetEnvironment(); void resetEnvironment();
static QString cleanPath(const QString &path);
const QSet<QString> &todo() const const QSet<QString> &todo() const
{ return m_todo; } { return m_todo; }
@@ -69,6 +68,8 @@ protected:
virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType type); virtual void sourceNeeded(unsigned line, const QString &fileName, IncludeType type);
private: private:
void addFrameworkPath(const QString &frameworkPath);
CPlusPlus::Snapshot m_snapshot; CPlusPlus::Snapshot m_snapshot;
QPointer<CppModelManager> m_modelManager; QPointer<CppModelManager> m_modelManager;
bool m_dumpFileNameWhileParsing; bool m_dumpFileNameWhileParsing;