some changes

changed datatype of parameter
changed name of parameter
This commit is contained in:
AustrianToast 2024-02-14 23:44:34 +01:00
parent 55cd833288
commit c292632545
No known key found for this signature in database
GPG Key ID: 5CD422268E489EB4
2 changed files with 9 additions and 9 deletions

View File

@ -7,10 +7,10 @@
// Rinse and Repeat // Rinse and Repeat
// Avoid recursion if possible // Avoid recursion if possible
std::vector<fs::path> find_all_files(std::string filesystem_path) { std::vector<fs::path> find_all_files(fs::path path) {
std::vector<fs::path> files = {}; std::vector<fs::path> files = {};
for (const fs::directory_entry & entry : fs::directory_iterator(filesystem_path)) { for (const fs::directory_entry & entry : fs::directory_iterator(path)) {
if (entry.is_directory()) { if (entry.is_directory()) {
continue; continue;
} }
@ -21,10 +21,10 @@ std::vector<fs::path> find_all_files(std::string filesystem_path) {
return files; return files;
} }
std::vector<fs::path> find_all_folders(std::string filesystem_path) { std::vector<fs::path> find_all_folders(fs::path path) {
std::vector<fs::path> folders = {}; std::vector<fs::path> folders = {};
for (const fs::directory_entry & entry : fs::directory_iterator(filesystem_path)) { for (const fs::directory_entry & entry : fs::directory_iterator(path)) {
if (entry.is_directory()) { if (entry.is_directory()) {
folders.insert(folders.begin()+folders.size(), entry.path()); folders.insert(folders.begin()+folders.size(), entry.path());
} }
@ -34,10 +34,10 @@ std::vector<fs::path> find_all_folders(std::string filesystem_path) {
return folders; return folders;
} }
std::vector<fs::path> find_all_files_and_folders(std::string filesystem_path) { std::vector<fs::path> find_all_files_and_folders(fs::path path) {
std::vector<fs::path> files_and_folders = {}; std::vector<fs::path> files_and_folders = {};
for (const fs::directory_entry &entry : fs::directory_iterator(filesystem_path)) { for (const fs::directory_entry &entry : fs::directory_iterator(path)) {
files_and_folders.insert(files_and_folders.begin()+files_and_folders.size(), entry.path()); files_and_folders.insert(files_and_folders.begin()+files_and_folders.size(), entry.path());
} }

View File

@ -3,6 +3,6 @@
#include <filesystem> #include <filesystem>
namespace fs = std::filesystem; namespace fs = std::filesystem;
std::vector<fs::path> find_all_files(std::string filesystem_path); std::vector<fs::path> find_all_files(fs::path path);
std::vector<fs::path> find_all_folders(std::string filesystem_path); std::vector<fs::path> find_all_folders(fs::path path);
std::vector<fs::path> find_all_files_and_folders(std::string filesystem_path); std::vector<fs::path> find_all_files_and_folders(fs::path path);