Utils: Implement FilePath::removeRecursively

Sprinkle a few QTC_ASSERT to make sure we are in a known
context.

Cmake's FileApiReader uses this before moving directories
as QFile::rename does not do anything if the target exists.

Change-Id: I555f99e81a9fe7d93ae66145eeebfa9d5880bc51
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-06-28 15:26:44 +02:00
parent 5470385085
commit 5ead2afeeb
8 changed files with 47 additions and 2 deletions

View File

@@ -82,6 +82,7 @@ public:
bool createDirectory(const Utils::FilePath &filePath) const override;
bool exists(const Utils::FilePath &filePath) const override;
bool removeFile(const Utils::FilePath &filePath) const override;
bool removeRecursively(const Utils::FilePath &filePath) const override;
bool copyFile(const Utils::FilePath &filePath, const Utils::FilePath &target) const override;
bool renameFile(const Utils::FilePath &filePath, const Utils::FilePath &target) const override;
Utils::FilePath searchInPath(const Utils::FilePath &filePath) const override;