diff --git a/src/fs_reader.cpp b/src/fs_reader.cpp index 1e1ceba..e00826a 100644 --- a/src/fs_reader.cpp +++ b/src/fs_reader.cpp @@ -7,10 +7,10 @@ // Rinse and Repeat // Avoid recursion if possible -std::vector find_all_files(std::string filesystem_path) { +std::vector find_all_files(fs::path path) { std::vector 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()) { continue; } @@ -21,10 +21,10 @@ std::vector find_all_files(std::string filesystem_path) { return files; } -std::vector find_all_folders(std::string filesystem_path) { +std::vector find_all_folders(fs::path path) { std::vector 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()) { folders.insert(folders.begin()+folders.size(), entry.path()); } @@ -34,10 +34,10 @@ std::vector find_all_folders(std::string filesystem_path) { return folders; } -std::vector find_all_files_and_folders(std::string filesystem_path) { +std::vector find_all_files_and_folders(fs::path path) { std::vector 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()); } diff --git a/src/fs_reader.h b/src/fs_reader.h index d358568..a394cb4 100644 --- a/src/fs_reader.h +++ b/src/fs_reader.h @@ -3,6 +3,6 @@ #include namespace fs = std::filesystem; -std::vector find_all_files(std::string filesystem_path); -std::vector find_all_folders(std::string filesystem_path); -std::vector find_all_files_and_folders(std::string filesystem_path); \ No newline at end of file +std::vector find_all_files(fs::path path); +std::vector find_all_folders(fs::path path); +std::vector find_all_files_and_folders(fs::path path); \ No newline at end of file