From 16faed678540be37ea623fa7f0f2c2e7c442b147 Mon Sep 17 00:00:00 2001 From: Squareys Date: Fri, 16 Feb 2018 14:27:04 +0100 Subject: [vcpkg] Add find/find_installed/is_installed for FeatureSpec Signed-off-by: Squareys --- toolsrc/include/vcpkg/statusparagraphs.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/statusparagraphs.h b/toolsrc/include/vcpkg/statusparagraphs.h index b3eec266a..fa064de7e 100644 --- a/toolsrc/include/vcpkg/statusparagraphs.h +++ b/toolsrc/include/vcpkg/statusparagraphs.h @@ -20,7 +20,21 @@ namespace vcpkg using iterator = container::reverse_iterator; using const_iterator = container::const_reverse_iterator; + /// Find the StatusParagraph for given spec. + /// Package specification to find the status paragraph for + /// Iterator for found spec const_iterator find(const PackageSpec& spec) const { return find(spec.name(), spec.triplet()); } + + /// Find the StatusParagraph for given feature spec. + /// Feature specification to find the status paragraph for + /// Iterator for found spec + const_iterator find(const FeatureSpec& spec) const { return find(spec.name(), spec.triplet(), spec.feature()); } + + /// Find a StatusParagraph by name, triplet and feature. + /// Package name + /// Triplet + /// Feature name + /// Iterator for found spec iterator find(const std::string& name, const Triplet& triplet, const std::string& feature = ""); const_iterator find(const std::string& name, const Triplet& triplet, const std::string& feature = "") const; @@ -28,9 +42,26 @@ namespace vcpkg Optional find_all_installed(const PackageSpec& spec) const; + /// Find the StatusParagraph for given spec if installed + /// Package specification to find the status for + /// Iterator for found spec const_iterator find_installed(const PackageSpec& spec) const; + + /// Find the StatusParagraph for given feature spec if installed + /// Feature specification to find the status for + /// Iterator for found spec + const_iterator find_installed(const FeatureSpec& spec) const; + + /// Find the StatusParagraph for given spec and return its install status + /// Package specification to check if installed + /// `true` if installed, `false` if not or not found. bool is_installed(const PackageSpec& spec) const; + /// Find the StatusParagraph for given feature spec and return its install status + /// Feature specification to check if installed + /// `true` if installed, `false` if not or not found. + bool is_installed(const FeatureSpec& spec) const; + iterator insert(std::unique_ptr); friend void serialize(const StatusParagraphs& pgh, std::string& out_str); -- cgit v1.2.3