aboutsummaryrefslogtreecommitdiff
path: root/paludis/broken_linkage_finder.cc
diff options
context:
space:
mode:
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-12-07 08:24:59 -0800
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-12-07 08:27:24 -0800
commitdc5c9bb30f29e402e3d4b2a9e0251ab64ec98eda (patch)
tree6a8b2005eca1c561484f3a9d69f29cfb85bb061c /paludis/broken_linkage_finder.cc
parent8f321d9a3dd1701fcec489362bbc74f37e102fb4 (diff)
downloadpaludis-dc5c9bb30f29e402e3d4b2a9e0251ab64ec98eda.tar.gz
paludis-dc5c9bb30f29e402e3d4b2a9e0251ab64ec98eda.tar.xz
introduce and use an iterator range in BrokenLinkageFinder
Add some convenience helpers for iteration to BrokenLinkageFinder. This allows us to use range based for loops in cave fix-linkage.
Diffstat (limited to 'paludis/broken_linkage_finder.cc')
-rw-r--r--paludis/broken_linkage_finder.cc27
1 files changed, 23 insertions, 4 deletions
diff --git a/paludis/broken_linkage_finder.cc b/paludis/broken_linkage_finder.cc
index 601281bb1..617e8bbb3 100644
--- a/paludis/broken_linkage_finder.cc
+++ b/paludis/broken_linkage_finder.cc
@@ -359,6 +359,12 @@ BrokenLinkageFinder::end_broken_packages() const
return BrokenPackageConstIterator(first_iterator(_imp->breakage.end()));
}
+IteratorRange<BrokenLinkageFinder::BrokenPackageConstIterator>
+BrokenLinkageFinder::broken_packages() const
+{
+ return {begin_broken_packages(), end_broken_packages()};
+}
+
BrokenLinkageFinder::BrokenFileConstIterator
BrokenLinkageFinder::begin_broken_files(const std::shared_ptr<const PackageID> & pkg) const
{
@@ -389,9 +395,15 @@ BrokenLinkageFinder::end_broken_files(const std::shared_ptr<const PackageID> & p
return BrokenFileConstIterator(first_iterator(_imp->orphan_breakage.end()));
}
+IteratorRange<BrokenLinkageFinder::BrokenFileConstIterator>
+BrokenLinkageFinder::broken_files(const std::shared_ptr<const PackageID> & package) const
+{
+ return {begin_broken_files(package), end_broken_files(package)};
+}
+
BrokenLinkageFinder::MissingRequirementConstIterator
-BrokenLinkageFinder::begin_missing_requirements(
- const std::shared_ptr<const PackageID> & pkg, const FSPath & file) const
+BrokenLinkageFinder::begin_missing_requirements(const std::shared_ptr<const PackageID> & pkg,
+ const FSPath & file) const
{
if (pkg)
{
@@ -416,8 +428,8 @@ BrokenLinkageFinder::begin_missing_requirements(
}
BrokenLinkageFinder::MissingRequirementConstIterator
-BrokenLinkageFinder::end_missing_requirements(
- const std::shared_ptr<const PackageID> & pkg, const FSPath & file) const
+BrokenLinkageFinder::end_missing_requirements(const std::shared_ptr<const PackageID> & pkg,
+ const FSPath & file) const
{
if (pkg)
{
@@ -441,6 +453,13 @@ BrokenLinkageFinder::end_missing_requirements(
}
}
+IteratorRange<BrokenLinkageFinder::MissingRequirementConstIterator>
+BrokenLinkageFinder::missing_requirements(const std::shared_ptr<const PackageID> & package,
+ const FSPath & file) const
+{
+ return {begin_missing_requirements(package, file), end_missing_requirements(package, file)};
+}
+
namespace paludis
{
template class PALUDIS_VISIBLE WrappedForwardIterator<BrokenLinkageFinder::BrokenPackageConstIteratorTag, const std::shared_ptr<const PackageID>>;