C++ Refactoring: Fix the include macros in header files after renaming

Fixes: QTCREATORBUG-4686
Change-Id: If22078bb183910941d8e2a94b0e8629baa2fa8de
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Miklos Marton
2020-05-08 18:06:26 +02:00
committed by Miklós Márton
parent 795ccfbffc
commit 3299239095
9 changed files with 289 additions and 13 deletions

View File

@@ -35,6 +35,8 @@ namespace Utils { class Environment; }
namespace Core {
enum class HandleIncludeGuards { No, Yes };
struct CORE_EXPORT FileUtils
{
// Helpers for common directory browser options.
@@ -48,7 +50,10 @@ struct CORE_EXPORT FileUtils
static QString msgTerminalWithAction();
// File operations aware of version control and file system case-insensitiveness
static void removeFile(const QString &filePath, bool deleteFromFS);
static bool renameFile(const QString &from, const QString &to);
static bool renameFile(const QString &from, const QString &to,
HandleIncludeGuards handleGuards = HandleIncludeGuards::No);
// This method is used to refactor the include guards in the renamed headers
static bool updateHeaderFileGuardAfterRename(const QString &headerPath, const QString &oldHeaderBaseName);
};
} // namespace Core