diff options
author | hjk <hjk@qt.io> | 2022-11-24 13:37:39 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2022-12-07 12:58:31 +0000 |
commit | 9a8d34ecf8a5bc39a555f633cb5b8a878a77d3d3 (patch) | |
tree | 087b634ea9cd9a5d0473d1f1f9060129a3d2f02a /src/plugins/cppeditor/cppsourceprocessor.h | |
parent | 89f438196454fc070d9cf3270579a2a7d4533966 (diff) | |
download | qt-creator-9a8d34ecf8a5bc39a555f633cb5b8a878a77d3d3.tar.gz |
CplusPlus: Pass FilePath to Preprocessor::run()
... and update caller sides.
Change-Id: I6a107e4a7fd9f7123cdc6f141da202845bcbbb66
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cppsourceprocessor.h')
-rw-r--r-- | src/plugins/cppeditor/cppsourceprocessor.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/plugins/cppeditor/cppsourceprocessor.h b/src/plugins/cppeditor/cppsourceprocessor.h index a3afeaac0a..83a8f28e54 100644 --- a/src/plugins/cppeditor/cppsourceprocessor.h +++ b/src/plugins/cppeditor/cppsourceprocessor.h @@ -31,8 +31,6 @@ public: using DocumentCallback = std::function<void (const CPlusPlus::Document::Ptr &)>; public: - static QString cleanPath(const QString &path); - CppSourceProcessor(const CPlusPlus::Snapshot &snapshot, DocumentCallback documentFinished); ~CppSourceProcessor() override; @@ -45,7 +43,7 @@ public: void setFileSizeLimitInMb(int fileSizeLimitInMb); void setTodo(const QSet<QString> &files); - void run(const QString &fileName, const QStringList &initialIncludes = QStringList()); + void run(const Utils::FilePath &filePath, const Utils::FilePaths &initialIncludes = {}); void removeFromCache(const Utils::FilePath &filePath); void resetEnvironment(); @@ -62,9 +60,9 @@ private: bool getFileContents(const Utils::FilePath &absoluteFilePath, QByteArray *contents, unsigned *revision) const; bool checkFile(const Utils::FilePath &absoluteFilePath) const; - QString resolveFile(const QString &fileName, IncludeType type); - QString resolveFile_helper(const QString &fileName, - ProjectExplorer::HeaderPaths::Iterator headerPathsIt); + Utils::FilePath resolveFile(const Utils::FilePath &filePath, IncludeType type); + Utils::FilePath resolveFile_helper(const Utils::FilePath &filePath, + ProjectExplorer::HeaderPaths::Iterator headerPathsIt); void mergeEnvironment(CPlusPlus::Document::Ptr doc); @@ -83,8 +81,8 @@ private: void markAsIncludeGuard(const QByteArray ¯oName) override; void startSkippingBlocks(int utf16charsOffset) override; void stopSkippingBlocks(int utf16charsOffset) override; - void sourceNeeded(int line, const QString &fileName, IncludeType type, - const QStringList &initialIncludes) override; + void sourceNeeded(int line, const Utils::FilePath &filePath, IncludeType type, + const Utils::FilePaths &initialIncludes) override; private: CPlusPlus::Snapshot m_snapshot; @@ -99,7 +97,7 @@ private: CPlusPlus::Document::Ptr m_currentDoc; QSet<QString> m_todo; QSet<QString> m_processed; - QHash<QString, QString> m_fileNameCache; + QHash<Utils::FilePath, Utils::FilePath> m_fileNameCache; int m_fileSizeLimitInMb = -1; QTextCodec *m_defaultCodec; }; |