mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-29 03:34:26 +08:00
[Files] Add functions to get all files of a dir recursively or non-recursively
This commit is contained in:
parent
0da18a3d53
commit
0b996a002e
@ -41,4 +41,12 @@ namespace vcpkg {namespace Files
|
||||
void recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension, std::vector<fs::path>* output);
|
||||
|
||||
std::vector<fs::path> recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension);
|
||||
|
||||
void recursive_find_all_files_in_dir(const fs::path& dir, std::vector<fs::path>* output);
|
||||
|
||||
std::vector<fs::path> recursive_find_all_files_in_dir(const fs::path& dir);
|
||||
|
||||
void non_recursive_find_all_files_in_dir(const fs::path& dir, std::vector<fs::path>* output);
|
||||
|
||||
std::vector<fs::path> non_recursive_find_all_files_in_dir(const fs::path& dir);
|
||||
}}
|
||||
|
@ -73,4 +73,34 @@ namespace vcpkg {namespace Files
|
||||
recursive_find_files_with_extension_in_dir(dir, extension, &v);
|
||||
return v;
|
||||
}
|
||||
|
||||
void recursive_find_all_files_in_dir(const fs::path& dir, std::vector<fs::path>* output)
|
||||
{
|
||||
recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current)
|
||||
{
|
||||
return !fs::is_directory(current);
|
||||
}, output);
|
||||
}
|
||||
|
||||
std::vector<fs::path> recursive_find_all_files_in_dir(const fs::path& dir)
|
||||
{
|
||||
std::vector<fs::path> v;
|
||||
recursive_find_all_files_in_dir(dir, &v);
|
||||
return v;
|
||||
}
|
||||
|
||||
void non_recursive_find_all_files_in_dir(const fs::path& dir, std::vector<fs::path>* output)
|
||||
{
|
||||
non_recursive_find_matching_paths_in_dir(dir, [&](const fs::path& current)
|
||||
{
|
||||
return !fs::is_directory(current);
|
||||
}, output);
|
||||
}
|
||||
|
||||
std::vector<fs::path> non_recursive_find_all_files_in_dir(const fs::path& dir)
|
||||
{
|
||||
std::vector<fs::path> v;
|
||||
non_recursive_find_all_files_in_dir(dir, &v);
|
||||
return v;
|
||||
}
|
||||
}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user