diff options
Diffstat (limited to 'src/core/file_sys/vfs.cpp')
| -rw-r--r-- | src/core/file_sys/vfs.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp index 7b584de7f..a4a3236f4 100644 --- a/src/core/file_sys/vfs.cpp +++ b/src/core/file_sys/vfs.cpp | |||
| @@ -384,6 +384,28 @@ bool VfsDirectory::DeleteSubdirectoryRecursive(std::string_view name) { | |||
| 384 | return success; | 384 | return success; |
| 385 | } | 385 | } |
| 386 | 386 | ||
| 387 | bool VfsDirectory::CleanSubdirectoryRecursive(std::string_view name) { | ||
| 388 | auto dir = GetSubdirectory(name); | ||
| 389 | if (dir == nullptr) { | ||
| 390 | return false; | ||
| 391 | } | ||
| 392 | |||
| 393 | bool success = true; | ||
| 394 | for (const auto& file : dir->GetFiles()) { | ||
| 395 | if (!dir->DeleteFile(file->GetName())) { | ||
| 396 | success = false; | ||
| 397 | } | ||
| 398 | } | ||
| 399 | |||
| 400 | for (const auto& sdir : dir->GetSubdirectories()) { | ||
| 401 | if (!dir->DeleteSubdirectoryRecursive(sdir->GetName())) { | ||
| 402 | success = false; | ||
| 403 | } | ||
| 404 | } | ||
| 405 | |||
| 406 | return success; | ||
| 407 | } | ||
| 408 | |||
| 387 | bool VfsDirectory::Copy(std::string_view src, std::string_view dest) { | 409 | bool VfsDirectory::Copy(std::string_view src, std::string_view dest) { |
| 388 | const auto f1 = GetFile(src); | 410 | const auto f1 = GetFile(src); |
| 389 | auto f2 = CreateFile(dest); | 411 | auto f2 = CreateFile(dest); |
| @@ -435,6 +457,10 @@ bool ReadOnlyVfsDirectory::DeleteSubdirectory(std::string_view name) { | |||
| 435 | return false; | 457 | return false; |
| 436 | } | 458 | } |
| 437 | 459 | ||
| 460 | bool ReadOnlyVfsDirectory::CleanSubdirectoryRecursive(std::string_view name) { | ||
| 461 | return false; | ||
| 462 | } | ||
| 463 | |||
| 438 | bool ReadOnlyVfsDirectory::DeleteFile(std::string_view name) { | 464 | bool ReadOnlyVfsDirectory::DeleteFile(std::string_view name) { |
| 439 | return false; | 465 | return false; |
| 440 | } | 466 | } |