mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 04:59:07 +08:00
Remove Files::check_is_directory()
This commit is contained in:
parent
4e26c6781c
commit
9b9a35fa38
@ -8,8 +8,6 @@ namespace vcpkg::Files
|
||||
{
|
||||
static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)";
|
||||
|
||||
void check_is_directory(const LineInfo& line_info, const fs::path& dirpath);
|
||||
|
||||
bool has_invalid_chars_for_filesystem(const std::string& s);
|
||||
|
||||
expected<std::string> read_contents(const fs::path& file_path) noexcept;
|
||||
|
@ -12,9 +12,15 @@ namespace vcpkg::Commands::Import
|
||||
std::vector<fs::path> libs;
|
||||
};
|
||||
|
||||
|
||||
void check_is_directory(const LineInfo& line_info, const fs::path& dirpath)
|
||||
{
|
||||
Checks::check_exit(line_info, fs::is_directory(dirpath), "The path %s is not a directory", dirpath.string());
|
||||
}
|
||||
|
||||
static Binaries find_binaries_in_dir(const fs::path& path)
|
||||
{
|
||||
Files::check_is_directory(VCPKG_LINE_INFO, path);
|
||||
check_is_directory(VCPKG_LINE_INFO, path);
|
||||
|
||||
Binaries binaries;
|
||||
binaries.dlls = Files::recursive_find_files_with_extension_in_dir(path, ".dll");
|
||||
@ -35,9 +41,9 @@ namespace vcpkg::Commands::Import
|
||||
|
||||
static void place_library_files_in(const fs::path& include_directory, const fs::path& project_directory, const fs::path& destination_path)
|
||||
{
|
||||
Files::check_is_directory(VCPKG_LINE_INFO, include_directory);
|
||||
Files::check_is_directory(VCPKG_LINE_INFO, project_directory);
|
||||
Files::check_is_directory(VCPKG_LINE_INFO, destination_path);
|
||||
check_is_directory(VCPKG_LINE_INFO, include_directory);
|
||||
check_is_directory(VCPKG_LINE_INFO, project_directory);
|
||||
check_is_directory(VCPKG_LINE_INFO, destination_path);
|
||||
Binaries debug_binaries = find_binaries_in_dir(project_directory / "Debug");
|
||||
Binaries release_binaries = find_binaries_in_dir(project_directory / "Release");
|
||||
|
||||
|
@ -6,11 +6,6 @@ namespace vcpkg::Files
|
||||
{
|
||||
static const std::regex FILESYSTEM_INVALID_CHARACTERS_REGEX = std::regex(R"([\/:*?"<>|])");
|
||||
|
||||
void check_is_directory(const LineInfo& line_info, const fs::path& dirpath)
|
||||
{
|
||||
Checks::check_exit(line_info, fs::is_directory(dirpath), "The path %s is not a directory", dirpath.string());
|
||||
}
|
||||
|
||||
bool has_invalid_chars_for_filesystem(const std::string& s)
|
||||
{
|
||||
return std::regex_search(s, FILESYSTEM_INVALID_CHARACTERS_REGEX);
|
||||
|
Loading…
Reference in New Issue
Block a user