| 869 | } |
| 870 | |
| 871 | SC::Result SC::AsyncFileSystemOperation::copyDirectory(AsyncEventLoop& eventLoop, StringSpan path, |
| 872 | StringSpan destinationPath, FileSystemCopyFlags copyFlags) |
| 873 | { |
| 874 | SC_TRY(checkState()); |
| 875 | operation = Operation::CopyDirectory; |
| 876 | new (©DirectoryData, PlacementNew()) CopyDirectoryData({path, destinationPath, copyFlags}); |
| 877 | loopWork.work = [&]() |
| 878 | { |
| 879 | SC_TRY(FileSystem::Operations::copyDirectory(copyDirectoryData.path, copyDirectoryData.destinationPath, |
| 880 | copyDirectoryData.copyFlags)); |
| 881 | return SC::Result(true); |
| 882 | }; |
| 883 | loopWork.callback.bind<AsyncFileSystemOperation, &AsyncFileSystemOperation::onOperationCompleted>(*this); |
| 884 | return eventLoop.start(loopWork); |
| 885 | } |
| 886 | |
| 887 | //------------------------------------------------------------------------------------------------------- |
| 888 | // AsyncEventLoop |