MCPcopy Create free account
hub / github.com/Tencent/libpag / DeleteDir

Function DeleteDir

viewer/src/utils/FileUtils.cpp:48–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48bool DeleteDir(const QString& path) {
49 QDir dir(path);
50 if (!dir.exists()) {
51 return true;
52 }
53
54 dir.setFilter(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden);
55 QFileInfoList fileList = dir.entryInfoList();
56 for (auto& fileInfo : fileList) {
57 if (fileInfo.isFile()) {
58 if (!fileInfo.dir().remove(fileInfo.fileName())) {
59 return false;
60 }
61 } else {
62 if (!DeleteDir(fileInfo.absoluteFilePath())) {
63 return false;
64 }
65 }
66 }
67
68 return dir.rmdir(path);
69}
70
71bool MakeDir(const QString& path, bool isDir) {
72 QString dirPath;

Callers 1

onFinishMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected