| 204 | } |
| 205 | |
| 206 | bool DiskUtils::remove(const Path& path) { |
| 207 | auto pathStr = path.toString(); |
| 208 | auto stat = statFromPath(pathStr.c_str()); |
| 209 | |
| 210 | if (stat.isDir()) { |
| 211 | auto content = DiskUtils::listDirectory(path); |
| 212 | for (const auto& file : content) { |
| 213 | if (!remove(file)) { |
| 214 | return false; |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | return std::remove(pathStr.c_str()) >= 0; |
| 220 | } |
| 221 | |
| 222 | std::vector<Path> DiskUtils::listDirectory(const Path& path) { |
| 223 | auto pathStr = path.toString(); |
nothing calls this directly
no test coverage detected