mirror of https://github.com/microsoft/vcpkg.git
[vcpkg] Added StatusParagraph::is_installed()
This commit is contained in:
parent
3e42585f47
commit
10d712ed01
|
|
@ -32,6 +32,8 @@ namespace vcpkg
|
|||
StatusParagraph();
|
||||
explicit StatusParagraph(std::unordered_map<std::string, std::string>&& fields);
|
||||
|
||||
bool is_installed() const { return want == Want::INSTALL && state == InstallState::INSTALLED; }
|
||||
|
||||
BinaryParagraph package;
|
||||
Want want;
|
||||
InstallState state;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ namespace vcpkg
|
|||
const Triplet& triplet) const
|
||||
{
|
||||
const const_iterator it = find(name, triplet);
|
||||
if (it != end() && (*it)->want == Want::INSTALL && (*it)->state == InstallState::INSTALLED)
|
||||
if (it != end() && (*it)->is_installed())
|
||||
{
|
||||
return it;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ namespace vcpkg
|
|||
std::vector<StatusParagraph*> installed_packages;
|
||||
for (auto&& pgh : status_db)
|
||||
{
|
||||
if (pgh->state != InstallState::INSTALLED || pgh->want != Want::INSTALL) continue;
|
||||
if (!pgh->is_installed()) continue;
|
||||
installed_packages.push_back(pgh.get());
|
||||
}
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ namespace vcpkg
|
|||
|
||||
for (const std::unique_ptr<StatusParagraph>& pgh : status_db)
|
||||
{
|
||||
if (pgh->state != InstallState::INSTALLED || !pgh->package.feature.empty())
|
||||
if (!pgh->is_installed() || !pgh->package.feature.empty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue