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

Method removeEmptyDirectory

Libraries/Async/Async.cpp:833–850  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831}
832
833SC::Result SC::AsyncFileSystemOperation::removeEmptyDirectory(AsyncEventLoop& eventLoop, StringSpan path)
834{
835 SC_TRY(checkState());
836 operation = Operation::RemoveDirectory;
837 new (&removeData, PlacementNew()) RemoveData({path});
838 if (not eventLoop.needsThreadPoolForFileOperations() and threadPoolMode != AsyncThreadPoolMode::ForceThreadPool)
839 {
840 return eventLoop.start(*this);
841 }
842
843 loopWork.work = [&]()
844 {
845 SC_TRY(FileSystem::Operations::removeEmptyDirectory(removeData.path));
846 return SC::Result(true);
847 };
848 loopWork.callback.bind<AsyncFileSystemOperation, &AsyncFileSystemOperation::onOperationCompleted>(*this);
849 return eventLoop.start(loopWork);
850}
851
852SC::Result SC::AsyncFileSystemOperation::removeFile(AsyncEventLoop& eventLoop, StringSpan path)
853{

Callers 15

runBuiltProgramFunction · 0.45
eventLoopWatchStopMethod · 0.45
threadRunnerMethod · 0.45
walkNotEnoughMethod · 0.45
testOpenMethod · 0.45
fileReadWriteMethod · 0.45
fileSendMethod · 0.45
formatErrorMethod · 0.45
makeRemoveIsDirectoryMethod · 0.45

Calls 5

PlacementNewClass · 0.85
removeEmptyDirectoryFunction · 0.85
ResultClass · 0.70
startMethod · 0.45

Tested by 15

runBuiltProgramFunction · 0.36
eventLoopWatchStopMethod · 0.36
threadRunnerMethod · 0.36
walkNotEnoughMethod · 0.36
testOpenMethod · 0.36
fileReadWriteMethod · 0.36
fileSendMethod · 0.36
formatErrorMethod · 0.36
makeRemoveIsDirectoryMethod · 0.36