aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_import.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-04-27 18:08:52 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-04-27 18:59:57 -0700
commit1e9471a1489156720362ef12e1ec6849ea9b45b6 (patch)
tree46f0f35093ecd18034c9f9463d6f8b7aa590ade0 /toolsrc/src/commands_import.cpp
parent75e8752cb90eb8bc7717518d9d6a5c68f27f2b0f (diff)
downloadvcpkg-1e9471a1489156720362ef12e1ec6849ea9b45b6.tar.gz
vcpkg-1e9471a1489156720362ef12e1ec6849ea9b45b6.zip
Run clang-format over the cpp files
Diffstat (limited to 'toolsrc/src/commands_import.cpp')
-rw-r--r--toolsrc/src/commands_import.cpp36
1 files changed, 25 insertions, 11 deletions
diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/commands_import.cpp
index 95e23302d..5db1885b2 100644
--- a/toolsrc/src/commands_import.cpp
+++ b/toolsrc/src/commands_import.cpp
@@ -1,7 +1,8 @@
#include "pch.h"
-#include "vcpkg_Commands.h"
+
#include "Paragraphs.h"
#include "StatusParagraph.h"
+#include "vcpkg_Commands.h"
#include "vcpkg_Files.h"
namespace vcpkg::Commands::Import
@@ -12,7 +13,6 @@ namespace vcpkg::Commands::Import
std::vector<fs::path> libs;
};
-
static void check_is_directory(const LineInfo& line_info, const Files::Filesystem& fs, const fs::path& dirpath)
{
Checks::check_exit(line_info, fs.is_directory(dirpath), "The path %s is not a directory", dirpath.string());
@@ -27,8 +27,7 @@ namespace vcpkg::Commands::Import
Binaries binaries;
for (auto&& file : files)
{
- if (fs.is_directory(file))
- continue;
+ if (fs.is_directory(file)) continue;
auto ext = file.extension();
if (ext == ".dll")
binaries.dlls.push_back(std::move(file));
@@ -38,7 +37,9 @@ namespace vcpkg::Commands::Import
return binaries;
}
- static void copy_files_into_directory(Files::Filesystem& fs, const std::vector<fs::path>& files, const fs::path& destination_folder)
+ static void copy_files_into_directory(Files::Filesystem& fs,
+ const std::vector<fs::path>& files,
+ const fs::path& destination_folder)
{
std::error_code ec;
fs.create_directory(destination_folder, ec);
@@ -50,7 +51,10 @@ namespace vcpkg::Commands::Import
}
}
- static void place_library_files_in(Files::Filesystem& fs, const fs::path& include_directory, const fs::path& project_directory, const fs::path& destination_path)
+ static void place_library_files_in(Files::Filesystem& fs,
+ const fs::path& include_directory,
+ const fs::path& project_directory,
+ const fs::path& destination_path)
{
check_is_directory(VCPKG_LINE_INFO, fs, include_directory);
check_is_directory(VCPKG_LINE_INFO, fs, project_directory);
@@ -59,7 +63,9 @@ namespace vcpkg::Commands::Import
Binaries release_binaries = find_binaries_in_dir(fs, project_directory / "Release");
fs::path destination_include_directory = destination_path / "include";
- fs.copy(include_directory, destination_include_directory, fs::copy_options::recursive | fs::copy_options::overwrite_existing);
+ fs.copy(include_directory,
+ destination_include_directory,
+ fs::copy_options::recursive | fs::copy_options::overwrite_existing);
copy_files_into_directory(fs, release_binaries.dlls, destination_path / "bin");
copy_files_into_directory(fs, release_binaries.libs, destination_path / "lib");
@@ -70,7 +76,10 @@ namespace vcpkg::Commands::Import
copy_files_into_directory(fs, debug_binaries.libs, destination_path / "debug" / "lib");
}
- static void do_import(const VcpkgPaths& paths, const fs::path& include_directory, const fs::path& project_directory, const BinaryParagraph& control_file_data)
+ static void do_import(const VcpkgPaths& paths,
+ const fs::path& include_directory,
+ const fs::path& project_directory,
+ const BinaryParagraph& control_file_data)
{
auto& fs = paths.get_filesystem();
fs::path library_destination_path = paths.package_dir(control_file_data.spec);
@@ -84,7 +93,8 @@ namespace vcpkg::Commands::Import
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
{
- static const std::string example = Commands::Help::create_example_string(R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)");
+ static const std::string example = Commands::Help::create_example_string(
+ R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)");
args.check_exact_arg_count(3, example);
args.check_and_get_optional_command_arguments({});
@@ -92,8 +102,12 @@ namespace vcpkg::Commands::Import
const fs::path include_directory(args.command_arguments[1]);
const fs::path project_directory(args.command_arguments[2]);
- const Expected<std::unordered_map<std::string, std::string>> pghs = Paragraphs::get_single_paragraph(paths.get_filesystem(), control_file_path);
- Checks::check_exit(VCPKG_LINE_INFO, pghs.get() != nullptr, "Invalid control file %s for package", control_file_path.generic_string());
+ const Expected<std::unordered_map<std::string, std::string>> pghs =
+ Paragraphs::get_single_paragraph(paths.get_filesystem(), control_file_path);
+ Checks::check_exit(VCPKG_LINE_INFO,
+ pghs.get() != nullptr,
+ "Invalid control file %s for package",
+ control_file_path.generic_string());
StatusParagraph spgh;
spgh.package = BinaryParagraph(*pghs.get());