diff options
| author | Squareys <squareys@googlemail.com> | 2018-02-16 14:27:04 +0100 |
|---|---|---|
| committer | Squareys <squareys@googlemail.com> | 2018-02-16 14:27:59 +0100 |
| commit | 16faed678540be37ea623fa7f0f2c2e7c442b147 (patch) | |
| tree | bebbed3c0d80dbe0b382a10fca45f6295891fdcc /toolsrc/include | |
| parent | f279e9f5e3a569b237dbaca44bbc7225f1d7e27d (diff) | |
| download | vcpkg-16faed678540be37ea623fa7f0f2c2e7c442b147.tar.gz vcpkg-16faed678540be37ea623fa7f0f2c2e7c442b147.zip | |
[vcpkg] Add find/find_installed/is_installed for FeatureSpec
Signed-off-by: Squareys <squareys@googlemail.com>
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/statusparagraphs.h | 31 |
1 files changed, 31 insertions, 0 deletions
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; + /// <summary>Find the StatusParagraph for given spec.</summary> + /// <param name="spec">Package specification to find the status paragraph for</param> + /// <returns>Iterator for found spec</returns> const_iterator find(const PackageSpec& spec) const { return find(spec.name(), spec.triplet()); } + + /// <summary>Find the StatusParagraph for given feature spec.</summary> + /// <param name="spec">Feature specification to find the status paragraph for</param> + /// <returns>Iterator for found spec</returns> + const_iterator find(const FeatureSpec& spec) const { return find(spec.name(), spec.triplet(), spec.feature()); } + + /// <summary>Find a StatusParagraph by name, triplet and feature.</summary> + /// <param name="name">Package name</param> + /// <param name="triplet">Triplet</param> + /// <param name="feature">Feature name</param> + /// <returns>Iterator for found spec</returns> 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<InstalledPackageView> find_all_installed(const PackageSpec& spec) const; + /// <summary>Find the StatusParagraph for given spec if installed</summary> + /// <param name="spec">Package specification to find the status for</param> + /// <returns>Iterator for found spec</returns> const_iterator find_installed(const PackageSpec& spec) const; + + /// <summary>Find the StatusParagraph for given feature spec if installed</summary> + /// <param name="spec">Feature specification to find the status for</param> + /// <returns>Iterator for found spec</returns> + const_iterator find_installed(const FeatureSpec& spec) const; + + /// <summary>Find the StatusParagraph for given spec and return its install status</summary> + /// <param name="spec">Package specification to check if installed</param> + /// <returns>`true` if installed, `false` if not or not found.</returns> bool is_installed(const PackageSpec& spec) const; + /// <summary>Find the StatusParagraph for given feature spec and return its install status</summary> + /// <param name="spec">Feature specification to check if installed</param> + /// <returns>`true` if installed, `false` if not or not found.</returns> + bool is_installed(const FeatureSpec& spec) const; + iterator insert(std::unique_ptr<StatusParagraph>); friend void serialize(const StatusParagraphs& pgh, std::string& out_str); |
