MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / removeFile

Method removeFile

Libraries/Async/Async.cpp:852–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

850 SC_TRY(
851 FileSystem::Operations::copyFile(copyFileData.path, copyFileData.destinationPath, copyFileData.copyFlags));
852 return SC::Result(true);
853 };
854 loopWork.callback.bind<AsyncFileSystemOperation, &AsyncFileSystemOperation::onOperationCompleted>(*this);
855 return eventLoop.start(loopWork);
856}
857
858SC::Result SC::AsyncFileSystemOperation::rename(AsyncEventLoop& eventLoop, StringSpan path, StringSpan newPath)
859{
860 SC_TRY(checkState());
861 operation = Operation::Rename;
862 new (&renameData, PlacementNew()) RenameData({path, newPath});
863 if (not eventLoop.needsThreadPoolForFileOperations() and threadPoolMode != AsyncThreadPoolMode::ForceThreadPool)
864 {
865 return eventLoop.start(*this);
866 }
867
868 loopWork.work = [&]()
869 {
870 SC_TRY(FileSystem::Operations::rename(renameData.path, renameData.newPath));
871 return SC::Result(true);
872 };

Callers 15

customMimeLookupMethod · 0.45
httpFileServerTestMethod · 0.45
putSpanBodyMethod · 0.45
requestOptionsMethod · 0.45
putStreamBodyMethod · 0.45
multipartUploadMethod · 0.45
eventLoopSubdirectoryMethod · 0.45
eventLoopWatchStopMethod · 0.45
threadRunnerMethod · 0.45
processForkMethod · 0.45
testOpenMethod · 0.45

Calls 5

PlacementNewClass · 0.85
removeFileFunction · 0.85
ResultClass · 0.70
startMethod · 0.45

Tested by 15

customMimeLookupMethod · 0.36
httpFileServerTestMethod · 0.36
putSpanBodyMethod · 0.36
requestOptionsMethod · 0.36
putStreamBodyMethod · 0.36
multipartUploadMethod · 0.36
eventLoopSubdirectoryMethod · 0.36
eventLoopWatchStopMethod · 0.36
threadRunnerMethod · 0.36
processForkMethod · 0.36
testOpenMethod · 0.36