MCPcopy Create free account
hub / github.com/FlagBrew/PKSM / STDirectory

Method STDirectory

common/source/io/STDirectory.cpp:30–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28#include <string.h>
29
30STDirectory::STDirectory(const std::string& root) : mError(0), mGood(false)
31{
32 DIR* dir = opendir(root.c_str());
33
34 if (dir == NULL)
35 {
36 mError = (Result)errno;
37 closedir(dir);
38 return;
39 }
40 else
41 {
42 struct dirent* ent;
43 while ((ent = readdir(dir)))
44 {
45 // Don't insert the implicit . and .. folders because ew
46 if (strcmp(ent->d_name, ".") && strcmp(ent->d_name, ".."))
47 {
48 mList.emplace_back(ent->d_name, ent->d_type == DT_DIR);
49 }
50 }
51 }
52
53 closedir(dir);
54 mGood = true;
55}
56
57Result STDirectory::error(void)
58{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected