diff options
Diffstat (limited to 'src/tools/clangrefactoringbackend/source/clangtool.h')
-rw-r--r-- | src/tools/clangrefactoringbackend/source/clangtool.h | 48 |
1 files changed, 13 insertions, 35 deletions
diff --git a/src/tools/clangrefactoringbackend/source/clangtool.h b/src/tools/clangrefactoringbackend/source/clangtool.h index 8b4e47df68..e3ff835799 100644 --- a/src/tools/clangrefactoringbackend/source/clangtool.h +++ b/src/tools/clangrefactoringbackend/source/clangtool.h @@ -30,6 +30,7 @@ #include <clangrefactoringbackend_global.h> #include <filecontainerv2.h> +#include <nativefilepath.h> #include <sourcelocationscontainer.h> #include <clang/Tooling/Refactoring.h> @@ -43,50 +44,34 @@ namespace ClangBackEnd { struct FileContent { - FileContent(const std::string &directory, - const std::string &fileName, - const std::string &content, - const std::vector<std::string> &commandLine) - : directory(directory), - fileName(fileName), - filePath(directory + nativeSeparator + fileName), - content(content), - commandLine(commandLine) + FileContent(NativeFilePath &&filePath, const Utils::SmallString &content) + : filePath(std::move(filePath)) + , content(std::move(content)) {} - std::string directory; - std::string fileName; - std::string filePath; + NativeFilePath filePath; std::string content; - std::vector<std::string> commandLine; }; struct UnsavedFileContent { - UnsavedFileContent(Utils::PathString &&filePath, - Utils::SmallString &&content) - : filePath(std::move(filePath)), - content(std::move(content)) + UnsavedFileContent(NativeFilePath &&filePath, Utils::SmallString &&content) + : filePath(std::move(filePath)) + , content(std::move(content)) {} - Utils::PathString filePath; + NativeFilePath filePath; Utils::SmallString content; }; class ClangTool { public: - void addFile(std::string &&directory, - std::string &&fileName, - std::string &&content, - std::vector<std::string> &&commandLine); - - template <typename Container> - void addFiles(const Container &filePaths, - const Utils::SmallStringVector &arguments); - void addFiles(const FilePaths &filePaths, - const Utils::SmallStringVector &arguments); + void addFile(FilePath &&filePath, + Utils::SmallString &&content, + Utils::SmallStringVector &&commandLine); + void addFiles(const FilePaths &filePaths, const Utils::SmallStringVector &arguments); void addUnsavedFiles(const V2::FileContainers &unsavedFiles); @@ -102,11 +87,4 @@ private: std::vector<UnsavedFileContent> m_unsavedFileContents; }; -extern template -void ClangTool::addFiles<Utils::SmallStringVector>(const Utils::SmallStringVector &filePaths, - const Utils::SmallStringVector &arguments); -extern template -void ClangTool::addFiles<Utils::PathStringVector>(const Utils::PathStringVector &filePaths, - const Utils::SmallStringVector &arguments); - } // namespace ClangBackEnd |