From 9a8d34ecf8a5bc39a555f633cb5b8a878a77d3d3 Mon Sep 17 00:00:00 2001 From: hjk Date: Thu, 24 Nov 2022 13:37:39 +0100 Subject: CplusPlus: Pass FilePath to Preprocessor::run() ... and update caller sides. Change-Id: I6a107e4a7fd9f7123cdc6f141da202845bcbbb66 Reviewed-by: Christian Stenger Reviewed-by: hjk Reviewed-by: Qt CI Bot Reviewed-by: Christian Kandeler --- src/plugins/cppeditor/cppsourceprocessor.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/plugins/cppeditor/cppsourceprocessor.h') 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; 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 &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 m_todo; QSet m_processed; - QHash m_fileNameCache; + QHash m_fileNameCache; int m_fileSizeLimitInMb = -1; QTextCodec *m_defaultCodec; }; -- cgit v1.2.1