diff options
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg_Dependencies.h | 13 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Maps.h | 18 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Sets.h | 17 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_cmd_arguments.h | 1 |
4 files changed, 48 insertions, 1 deletions
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 <vector> +#include "package_spec.h" +#include "StatusParagraphs.h" +#include <unordered_set> +#include "vcpkg_paths.h" + +namespace vcpkg {namespace Dependencies +{ + std::vector<package_spec> create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector<package_spec>& specs, const StatusParagraphs& status_db); + + std::unordered_set<package_spec> find_unmet_dependencies(const vcpkg_paths& paths, const std::vector<package_spec>& specs, const StatusParagraphs& status_db); +}} 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 <unordered_map> +#include <unordered_set> + +namespace vcpkg { namespace Maps +{ + template <typename K, typename V> + std::unordered_set<K> extract_key_set(const std::unordered_map<K, V>& input_map) + { + std::unordered_set<K> key_set; + for (auto const& element : input_map) + { + key_set.insert(element.first); + } + return key_set; + } +}} 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 <unordered_set> + +namespace vcpkg { namespace Sets +{ + template <typename T, typename Container> + void remove_all(std::unordered_set<T>* 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); + } + } +}} diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 5a5075d23..704290589 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<package_spec> parse_all_arguments_as_package_specs(const vcpkg_paths& paths, const triplet& default_target_triplet, const char* example_text = nullptr) const; - std::vector<package_spec> extract_package_specs_with_unmet_dependencies(const vcpkg_paths& paths, const triplet& default_target_triplet, const StatusParagraphs& status_db) const; private: std::unordered_set<std::string> optional_command_arguments; |
