diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-12 21:37:55 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-12 22:05:03 -0700 |
| commit | 2fa87fbb0aba1eba96994beb0c7b32d52f7f7161 (patch) | |
| tree | fbf86a06efd8741f36f1568b6f7eb38657c96b21 /toolsrc/include | |
| parent | 5131e955a809b421345506cd614c8578ab86fa71 (diff) | |
| download | vcpkg-2fa87fbb0aba1eba96994beb0c7b32d52f7f7161.tar.gz vcpkg-2fa87fbb0aba1eba96994beb0c7b32d52f7f7161.zip | |
Simplify Remove plan generation
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg_Dependencies.h | 41 |
1 files changed, 14 insertions, 27 deletions
diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 155fb12e6..f35250447 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -7,15 +7,6 @@ namespace vcpkg::Dependencies { - struct AnyParagraph - { - std::vector<PackageSpec> dependencies(const Triplet& triplet) const; - - Optional<StatusParagraph> status_paragraph; - Optional<BinaryParagraph> binary_paragraph; - Optional<SourceParagraph> source_paragraph; - }; - enum class RequestType { UNKNOWN, @@ -25,6 +16,15 @@ namespace vcpkg::Dependencies std::string to_output_string(RequestType request_type, const CStringView s); + struct AnyParagraph + { + std::vector<PackageSpec> dependencies(const Triplet& triplet) const; + + Optional<StatusParagraph> status_paragraph; + Optional<BinaryParagraph> binary_paragraph; + Optional<SourceParagraph> source_paragraph; + }; + enum class InstallPlanType { UNKNOWN, @@ -57,36 +57,23 @@ namespace vcpkg::Dependencies REMOVE }; - struct SpecAndRemovePlanType - { - PackageSpec spec; - RemovePlanType plan_type; - }; - struct RemovePlanAction { + static bool compare_by_name(const RemovePlanAction* left, const RemovePlanAction* right); + RemovePlanAction(); - RemovePlanAction(const RemovePlanType& plan_type, const RequestType& request_type); + RemovePlanAction(const PackageSpec& spec, const RemovePlanType& plan_type, const RequestType& request_type); RemovePlanAction(const RemovePlanAction&) = delete; RemovePlanAction(RemovePlanAction&&) = default; RemovePlanAction& operator=(const RemovePlanAction&) = delete; RemovePlanAction& operator=(RemovePlanAction&&) = default; + PackageSpec spec; RemovePlanType plan_type; RequestType request_type; }; - struct PackageSpecWithRemovePlan - { - static bool compare_by_name(const PackageSpecWithRemovePlan* left, const PackageSpecWithRemovePlan* right); - - PackageSpecWithRemovePlan(const PackageSpec& spec, RemovePlanAction&& plan); - - PackageSpec spec; - RemovePlanAction plan; - }; - std::vector<InstallPlanAction> create_install_plan(const VcpkgPaths& paths, const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db); - std::vector<PackageSpecWithRemovePlan> create_remove_plan(const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db); + std::vector<RemovePlanAction> create_remove_plan(const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db); } |
