aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkglib.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-03-29 16:00:41 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2017-03-31 16:15:05 -0700
commitf1d4a4457ece7067bff16479b6e86d06770d3095 (patch)
treee8d10403053b5aed8a34d80867c37d06207a4a44 /toolsrc/src/vcpkglib.cpp
parentb3773070fee854ad7a9ea93b8f65b09239947f36 (diff)
downloadvcpkg-f1d4a4457ece7067bff16479b6e86d06770d3095.tar.gz
vcpkg-f1d4a4457ece7067bff16479b6e86d06770d3095.zip
Introduce get_installed_ports()
Diffstat (limited to 'toolsrc/src/vcpkglib.cpp')
-rw-r--r--toolsrc/src/vcpkglib.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkglib.cpp
index cfdb17002..e96f1c33f 100644
--- a/toolsrc/src/vcpkglib.cpp
+++ b/toolsrc/src/vcpkglib.cpp
@@ -171,6 +171,19 @@ namespace vcpkg
fs::rename(updated_listfile_path, listfile_path);
}
+ std::vector<StatusParagraph*> get_installed_ports(const StatusParagraphs& status_db)
+ {
+ std::vector<StatusParagraph*> installed_packages;
+ for (auto&& pgh : status_db)
+ {
+ if (pgh->state == install_state_t::not_installed && pgh->want == want_t::purge)
+ continue;
+ installed_packages.push_back(pgh.get());
+ }
+
+ return installed_packages;
+ }
+
std::vector<StatusParagraph_and_associated_files> get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db)
{
std::vector<StatusParagraph_and_associated_files> installed_files;