aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/commands_owns.cpp
diff options
context:
space:
mode:
authorAlexander Kaspar <alexander.kaspar@gmail.com>2016-12-02 09:00:27 +0100
committerAlexander Kaspar <alexander.kaspar@gmail.com>2016-12-02 09:00:27 +0100
commit279f6d5830ea3f47b2f09695b6113d84083c2674 (patch)
tree00dd4fb47bdd1da71ccd34e5c79e0d49ec90e202 /toolsrc/src/commands_owns.cpp
parent0f797c7a0127e2575e3ac0ad56d829383ec5b5ae (diff)
parent25b6ef7a9d4ad73ae6123be715a7904c101f31fc (diff)
downloadvcpkg-279f6d5830ea3f47b2f09695b6113d84083c2674.tar.gz
vcpkg-279f6d5830ea3f47b2f09695b6113d84083c2674.zip
Merge branch 'master' of https://github.com/Microsoft/vcpkg into qca
Diffstat (limited to 'toolsrc/src/commands_owns.cpp')
-rw-r--r--toolsrc/src/commands_owns.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp
index e5599ce01..45f073304 100644
--- a/toolsrc/src/commands_owns.cpp
+++ b/toolsrc/src/commands_owns.cpp
@@ -1,30 +1,21 @@
#include "vcpkg_Commands.h"
#include "vcpkg_System.h"
#include "vcpkg.h"
-#include <fstream>
namespace vcpkg
{
static void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db)
{
- std::string line;
-
- for (auto&& pgh : status_db)
+ const std::vector<StatusParagraph_and_associated_files> installed_files = get_installed_files(paths, status_db);
+ for (const StatusParagraph_and_associated_files& pgh_and_file : installed_files)
{
- if (pgh->state != install_state_t::installed)
- continue;
+ const StatusParagraph& pgh = pgh_and_file.pgh;
- std::fstream listfile(paths.listfile_path(pgh->package));
- while (std::getline(listfile, line))
+ for (const std::string& file : pgh_and_file.files)
{
- if (line.empty())
- {
- continue;
- }
-
- if (line.find(file_substr) != std::string::npos)
+ if (file.find(file_substr) != std::string::npos)
{
- System::println("%s: %s", pgh->package.displayname(), line);
+ System::println("%s: %s", pgh.package.displayname(), file);
}
}
}