From c699d5715b2e768ef2f7742a1894742df982038b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Sep 2016 23:27:46 -0700 Subject: Introduce vcpkg::Sets utility namespace --- toolsrc/include/vcpkg_Sets.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 toolsrc/include/vcpkg_Sets.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Sets.h b/toolsrc/include/vcpkg_Sets.h new file mode 100644 index 000000000..7b330f31c --- /dev/null +++ b/toolsrc/include/vcpkg_Sets.h @@ -0,0 +1,17 @@ +#pragma once + +#include "vcpkg_Checks.h" +#include + +namespace vcpkg { namespace Sets +{ + template + void remove_all(std::unordered_set* input_set, Container remove_these) + { + Checks::check_throw(input_set != nullptr, "Input set cannot be null"); + for (const T& r : remove_these) + { + input_set->erase(r); + } + } +}} -- cgit v1.2.3 From addecbfdefe9f00214db9af438b0fe255e92a16a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Sep 2016 23:28:14 -0700 Subject: Introduce vcpkg_Maps utility namespace --- toolsrc/include/vcpkg_Maps.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 toolsrc/include/vcpkg_Maps.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h new file mode 100644 index 000000000..5b7b8ed46 --- /dev/null +++ b/toolsrc/include/vcpkg_Maps.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +namespace vcpkg { namespace Maps +{ + template + std::unordered_set extract_key_set(const std::unordered_map& input_map) + { + std::unordered_set key_set; + for (auto const& element : input_map) + { + key_set.insert(element.first); + } + return key_set; + } +}} -- cgit v1.2.3 From 33a2969b9c80c602a28e0d53560f39915de933fc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Sep 2016 23:28:50 -0700 Subject: Refactor dependency related code to vcpkg::Dependencies --- toolsrc/include/vcpkg_Dependencies.h | 13 +++++++++++++ toolsrc/include/vcpkg_cmd_arguments.h | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 toolsrc/include/vcpkg_Dependencies.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h new file mode 100644 index 000000000..94aa51f99 --- /dev/null +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -0,0 +1,13 @@ +#pragma once +#include +#include "package_spec.h" +#include "StatusParagraphs.h" +#include +#include "vcpkg_paths.h" + +namespace vcpkg {namespace Dependencies +{ + std::vector create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + + std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); +}} diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 0df3d1222..7df3d64b1 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -28,7 +28,6 @@ namespace vcpkg void check_max_args(size_t arg_count, const char* example_text = nullptr) const; std::vector parse_all_arguments_as_package_specs(const triplet& default_target_triplet, const char* example_text = nullptr) const; - std::vector extract_package_specs_with_unmet_dependencies(const vcpkg_paths& paths, const triplet& default_target_triplet, const StatusParagraphs& status_db) const; private: std::unordered_set optional_command_arguments; -- cgit v1.2.3