MCPcopy Create free account
hub / github.com/Snapchat/Valdi / listDirectory

Method listDirectory

valdi_core/src/valdi_core/cpp/Utils/DiskUtils.cpp:222–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220}
221
222std::vector<Path> DiskUtils::listDirectory(const Path& path) {
223 auto pathStr = path.toString();
224 std::vector<Path> out;
225
226 auto* dir = opendir(pathStr.c_str());
227 if (dir != nullptr) {
228 struct dirent* dp = nullptr;
229 while ((dp = readdir(dir)) != nullptr) {
230 std::string_view filepath(dp->d_name);
231
232 if (filepath != ".." && filepath != ".") {
233 out.emplace_back(path.appending(filepath));
234 }
235 }
236
237 closedir(dir);
238 }
239
240 return out;
241}
242
243Path DiskUtils::temporaryFilePath() {
244 char tempFileName[L_tmpnam];

Callers

nothing calls this directly

Calls 3

readdirFunction · 0.85
toStringMethod · 0.65
appendingMethod · 0.45

Tested by

no test coverage detected