prettyprinters.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef APT_PRETTYPRINTERS_H
  2. #define APT_PRETTYPRINTERS_H
  3. #include <apt-pkg/pkgcache.h>
  4. #include <apt-pkg/macros.h>
  5. class pkgDepCache;
  6. namespace APT {
  7. /** helper to format PkgIterator for easier printing in debug messages.
  8. *
  9. * The actual text generated is subject to change without prior notice
  10. * and should NOT be used as part of a general user interface.
  11. */
  12. struct PrettyPkg
  13. {
  14. pkgDepCache * const DepCache;
  15. pkgCache::PkgIterator const Pkg;
  16. PrettyPkg(pkgDepCache * const depcache, pkgCache::PkgIterator const &pkg) APT_NONNULL(2) : DepCache(depcache), Pkg(pkg) {}
  17. };
  18. /** helper to format DepIterator for easier printing in debug messages.
  19. *
  20. * The actual text generated is subject to change without prior notice
  21. * and should NOT be used as part of a general user interface.
  22. */
  23. struct PrettyDep
  24. {
  25. pkgDepCache * const DepCache;
  26. pkgCache::DepIterator const Dep;
  27. PrettyDep(pkgDepCache * const depcache, pkgCache::DepIterator const &dep) APT_NONNULL(2) : DepCache(depcache), Dep(dep) {}
  28. };
  29. }
  30. std::ostream& operator<<(std::ostream& os, const APT::PrettyPkg& pp);
  31. std::ostream& operator<<(std::ostream& os, const APT::PrettyDep& pd);
  32. #endif