| 33 | } |
| 34 | |
| 35 | std::vector<std::string> StdExplorer::GetDirectories(const std::string &path) { |
| 36 | std::vector<std::string> dirs; |
| 37 | const auto full_path = this->MakeFull(path); |
| 38 | |
| 39 | auto dp = opendir(full_path.c_str()); |
| 40 | if(dp) { |
| 41 | while(true) { |
| 42 | auto dt = readdir(dp); |
| 43 | if(dt == nullptr) { |
| 44 | break; |
| 45 | } |
| 46 | const std::string name = dt->d_name; |
| 47 | if((name != ".") && (name != "..")) { |
| 48 | if(dt->d_type & DT_DIR) { |
| 49 | dirs.push_back(name); |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | closedir(dp); |
| 54 | } |
| 55 | return dirs; |
| 56 | } |
| 57 | |
| 58 | std::vector<std::string> StdExplorer::GetFiles(const std::string &path) { |
| 59 | std::vector<std::string> files; |
no test coverage detected