| 5 | namespace Fallback |
| 6 | { |
| 7 | static bool copyFolderAddSuffixImpl(std::filesystem::path const& source, std::filesystem::path const& destination) |
| 8 | { |
| 9 | auto const folderName = source.filename().wstring(); |
| 10 | std::error_code ec; |
| 11 | for (int suffix = 1;; ++suffix) |
| 12 | { |
| 13 | auto const fullPath = std::format(LR"({}\{}({}))", destination.wstring(), folderName, suffix); |
| 14 | if (!std::filesystem::exists(fullPath)) |
| 15 | { |
| 16 | |
| 17 | std::filesystem::copy(source, fullPath, std::filesystem::copy_options::recursive |
| 18 | |std::filesystem::copy_options::update_existing, ec); |
| 19 | return bool{ ec }; |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | static bool copyFileAddSuffixImpl(std::filesystem::path const& source, std::filesystem::path const& destination) |
| 25 | { |