summaryrefslogtreecommitdiffstats
path: root/apt-pkg/prettyprinters.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
commit851b6a097165af4d51c0db01b5e05256e5006896 (patch)
tree5f7c388ec894a7806c49a99f3bdb605d0b299a7c /apt-pkg/prettyprinters.h
parentInitial commit. (diff)
downloadapt-851b6a097165af4d51c0db01b5e05256e5006896.tar.xz
apt-851b6a097165af4d51c0db01b5e05256e5006896.zip
Adding upstream version 2.6.1.upstream/2.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-pkg/prettyprinters.h')
-rw-r--r--apt-pkg/prettyprinters.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/apt-pkg/prettyprinters.h b/apt-pkg/prettyprinters.h
new file mode 100644
index 0000000..80b7729
--- /dev/null
+++ b/apt-pkg/prettyprinters.h
@@ -0,0 +1,37 @@
+#ifndef APT_PRETTYPRINTERS_H
+#define APT_PRETTYPRINTERS_H
+#include <apt-pkg/macros.h>
+#include <apt-pkg/pkgcache.h>
+
+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) {}
+};
+
+}
+APT_PUBLIC std::ostream& operator<<(std::ostream& os, const APT::PrettyPkg& pp);
+APT_PUBLIC std::ostream& operator<<(std::ostream& os, const APT::PrettyDep& pd);
+
+#endif