~~Cleanup~~ Changes. (#14)

* No builds allowed here as always on other branches, lmao.

* Changes. ;)
This commit is contained in:
StackZ 2019-12-30 04:59:16 +01:00 committed by GitHub
commit e95b48011a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 345 additions and 239 deletions

View file

@ -25,7 +25,7 @@ extern bool continueNdsScan;
extern uint selectedFile;
extern int keyRepeatDelay;
extern bool dirChanged;
extern std::vector<DirEntry> dirContents;
std::vector<DirEntry> dirContents;
extern bool touching(touchPosition touch, Structs::ButtonPos button);
extern touchPosition touch;
@ -191,6 +191,21 @@ std::vector<std::string> getContents(const std::string &name, const std::vector<
return dirContents;
}
// Directory exist?
bool returnIfExist(const std::string &path, const std::vector<std::string> &extensionList) {
dirContents.clear();
chdir(path.c_str());
std::vector<DirEntry> dirContentsTemp;
getDirectoryContents(dirContentsTemp, extensionList);
for(uint i=0;i<dirContentsTemp.size();i++) {
dirContents.push_back(dirContentsTemp[i]);
}
if (dirContents.size() == 0) {
return false;
}
return true;
}
// returns a Path or file to 'std::string'.
// selectText is the Text which is displayed on the bottom bar of the top screen.
// selectionMode is how you select it. 1 -> Path, 2 -> File.