[vcpkg] Added StatusParagraph::is_installed()

This commit is contained in:
Robert Schumacher 2018-01-23 01:56:25 -08:00
parent 3e42585f47
commit 10d712ed01
3 changed files with 5 additions and 3 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}