From 636c7dc17286d93d788c741d15fd756aeda066d5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 20:07:13 +0200 Subject: Adding upstream version 1.8.2.3. Signed-off-by: Daniel Baumann --- apt-pkg/prettyprinters.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 apt-pkg/prettyprinters.h (limited to 'apt-pkg/prettyprinters.h') diff --git a/apt-pkg/prettyprinters.h b/apt-pkg/prettyprinters.h new file mode 100644 index 0000000..40f9d66 --- /dev/null +++ b/apt-pkg/prettyprinters.h @@ -0,0 +1,37 @@ +#ifndef APT_PRETTYPRINTERS_H +#define APT_PRETTYPRINTERS_H +#include +#include + +class pkgDepCache; + +namespace APT { + +/** helper to format PkgIterator for easier printing in debug messages. + * + * The actual text generated is subject to change without prior notice + * and should NOT be used as part of a general user interface. + */ +struct PrettyPkg +{ + pkgDepCache * const DepCache; + pkgCache::PkgIterator const Pkg; + PrettyPkg(pkgDepCache * const depcache, pkgCache::PkgIterator const &pkg) APT_NONNULL(2) : DepCache(depcache), Pkg(pkg) {} +}; +/** helper to format DepIterator for easier printing in debug messages. + * + * The actual text generated is subject to change without prior notice + * and should NOT be used as part of a general user interface. + */ +struct PrettyDep +{ + pkgDepCache * const DepCache; + pkgCache::DepIterator const Dep; + PrettyDep(pkgDepCache * const depcache, pkgCache::DepIterator const &dep) APT_NONNULL(2) : DepCache(depcache), Dep(dep) {} +}; + +} +std::ostream& operator<<(std::ostream& os, const APT::PrettyPkg& pp); +std::ostream& operator<<(std::ostream& os, const APT::PrettyDep& pd); + +#endif -- cgit v1.2.3