summaryrefslogtreecommitdiffstats
path: root/apt-pkg/solver3.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:28:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:28:44 +0000
commit179b27be1e4cf4e68ccb9df64c64156dbb7b3820 (patch)
tree656b95c0086c4c552c43914f47b3c292b0276618 /apt-pkg/solver3.h
parentAdding upstream version 2.9.6. (diff)
downloadapt-179b27be1e4cf4e68ccb9df64c64156dbb7b3820.tar.xz
apt-179b27be1e4cf4e68ccb9df64c64156dbb7b3820.zip
Adding upstream version 2.9.7.upstream/2.9.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-pkg/solver3.h')
-rw-r--r--apt-pkg/solver3.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/apt-pkg/solver3.h b/apt-pkg/solver3.h
index d460c95..96faaa6 100644
--- a/apt-pkg/solver3.h
+++ b/apt-pkg/solver3.h
@@ -219,6 +219,16 @@ struct APT::Solver::Reason
{
return IsVersion ? map_pointer<pkgCache::Version>{(uint32_t)MapPtr} : 0;
}
+ // \brief Return the package iterator if storing a package, or an empty one
+ pkgCache::PkgIterator Pkg(pkgCache &cache) const
+ {
+ return IsVersion ? pkgCache::PkgIterator() : pkgCache::PkgIterator(cache, cache.PkgP + Pkg());
+ }
+ // \brief Return the version iterator if storing a package, or an empty end.
+ pkgCache::VerIterator Ver(pkgCache &cache) const
+ {
+ return IsVersion ? pkgCache::VerIterator(cache, cache.VerP + Ver()) : pkgCache::VerIterator();
+ }
// \brief Check if there is no reason.
bool empty() const
{