From 9112f77703c39d46e2e0471c48c8a5e1f93f4abf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 13 Jul 2015 03:36:59 +0200 Subject: show or-groups in not-installed recommends and suggests lists Further abstracting our new ShowList allows to use it for containers of strings as well giving us the option to implement an or-groups display for the recommends and suggests lists which is a nice trick given that it also helps with migrating the last remaining other cases of old ShowList. --- apt-private/private-output.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'apt-private/private-output.h') diff --git a/apt-private/private-output.h b/apt-private/private-output.h index b9151b245..4930fd981 100644 --- a/apt-private/private-output.h +++ b/apt-private/private-output.h @@ -34,11 +34,11 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, APT_PUBLIC void ShowBroken(std::ostream &out, CacheFile &Cache, bool const Now); APT_PUBLIC void ShowBroken(std::ostream &out, pkgCacheFile &Cache, bool const Now); -template APT_PUBLIC bool ShowList(std::ostream &out, std::string const &Title, +template APT_PUBLIC bool ShowList(std::ostream &out, std::string const &Title, Container const &cont, - std::function Predicate, - std::function PkgDisplay, - std::function VerboseDisplay) + PredicateC Predicate, + DisplayP PkgDisplay, + DisplayV VerboseDisplay) { size_t const ScreenWidth = (::ScreenWidth > 3) ? ::ScreenWidth - 3 : 0; int ScreenUsed = 0; @@ -88,8 +88,6 @@ template APT_PUBLIC bool ShowList(std::ostream &out, std::strin } return true; } -APT_DEPRECATED APT_PUBLIC bool ShowList(std::ostream &out, std::string Title, std::string List, - std::string VersionsList); void ShowNew(std::ostream &out,CacheFile &Cache); void ShowDel(std::ostream &out,CacheFile &Cache); @@ -106,12 +104,12 @@ void Stats(std::ostream &out, pkgDepCache &Dep); bool YnPrompt(bool Default=true); bool AnalPrompt(const char *Text); -APT_PUBLIC std::string PrettyFullName(pkgCache::PkgIterator const &Pkg); -APT_PUBLIC std::string CandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); -APT_PUBLIC std::function CandidateVersion(pkgCacheFile * const Cache); -APT_PUBLIC std::string CurrentToCandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); -APT_PUBLIC std::function CurrentToCandidateVersion(pkgCacheFile * const Cache); -APT_PUBLIC std::string EmptyString(pkgCache::PkgIterator const &); -APT_PUBLIC bool AlwaysTrue(pkgCache::PkgIterator const &); +std::string PrettyFullName(pkgCache::PkgIterator const &Pkg); +std::string CandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); +std::function CandidateVersion(pkgCacheFile * const Cache); +std::string CurrentToCandidateVersion(pkgCacheFile * const Cache, pkgCache::PkgIterator const &Pkg); +std::function CurrentToCandidateVersion(pkgCacheFile * const Cache); +std::string EmptyString(pkgCache::PkgIterator const &); +bool AlwaysTrue(pkgCache::PkgIterator const &); #endif -- cgit v1.2.3-70-g09d2