some changes
changed datatype of parameter changed name of parameter
This commit is contained in:
parent
55cd833288
commit
c292632545
@ -7,10 +7,10 @@
|
||||
// Rinse and Repeat
|
||||
|
||||
// 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 = {};
|
||||
|
||||
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<fs::path> find_all_files(std::string filesystem_path) {
|
||||
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 = {};
|
||||
|
||||
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<fs::path> find_all_folders(std::string filesystem_path) {
|
||||
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 = {};
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,6 @@
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
std::vector<fs::path> find_all_files(std::string filesystem_path);
|
||||
std::vector<fs::path> find_all_folders(std::string filesystem_path);
|
||||
std::vector<fs::path> find_all_files_and_folders(std::string filesystem_path);
|
||||
std::vector<fs::path> find_all_files(fs::path path);
|
||||
std::vector<fs::path> find_all_folders(fs::path path);
|
||||
std::vector<fs::path> find_all_files_and_folders(fs::path path);
|
Loading…
x
Reference in New Issue
Block a user