aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorAlbert Ziegenhagel <albert.ziegenhagel@outlook.com>2016-09-23 09:58:33 +0200
committerAlbert Ziegenhagel <albert.ziegenhagel@outlook.com>2016-09-23 09:58:33 +0200
commit430f53af7d2d8b9a2bda1986bd6ecb8eb7630b5d (patch)
treeb7618c81d8844c387b78861ee96af91109a633fe /toolsrc/include
parent31935aa0fd142cbb4e0db1a62ba1483294b740f8 (diff)
parent5b89712df01c96242ced20c38f0fa27631c3f4e3 (diff)
downloadvcpkg-430f53af7d2d8b9a2bda1986bd6ecb8eb7630b5d.tar.gz
vcpkg-430f53af7d2d8b9a2bda1986bd6ecb8eb7630b5d.zip
Merge branch 'master' into default_triplet
# Conflicts: # toolsrc/include/vcpkg_cmd_arguments.h # toolsrc/src/commands_installation.cpp # toolsrc/src/vcpkg_cmd_arguments.cpp
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg_Dependencies.h13
-rw-r--r--toolsrc/include/vcpkg_Maps.h18
-rw-r--r--toolsrc/include/vcpkg_Sets.h17
-rw-r--r--toolsrc/include/vcpkg_cmd_arguments.h1
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;