Implement Script Downloading and parsing of the Informations.

To-Do: Revision checking of the current and new Scripts.
This commit is contained in:
VoltZ
2019-11-06 13:54:45 +01:00
parent 77680d2a78
commit 715c09179b
8 changed files with 103 additions and 83 deletions
+12
View File
@@ -159,4 +159,16 @@ void getDirectoryContents(std::vector<DirEntry>& dirContents, const std::vector<
void getDirectoryContents(std::vector<DirEntry>& dirContents) {
getDirectoryContents(dirContents, {});
}
std::vector<std::string> getContents(const std::string &name, const std::vector<std::string> &extensionList) {
std::vector<std::string> dirContents;
DIR* pdir = opendir(name.c_str());
struct dirent *pent;
while ((pent = readdir(pdir)) != NULL) {
if(nameEndsWith(pent->d_name, extensionList))
dirContents.push_back(pent->d_name);
}
closedir(pdir);
return dirContents;
}