File: prettyprinters.h

package info (click to toggle)
apt 1.8.2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 19,680 kB
  • sloc: cpp: 67,708; sh: 24,865; xml: 5,187; perl: 577; ansic: 190; makefile: 28; python: 28
file content (37 lines) | stat: -rw-r--r-- 1,165 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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) {}
};

}
std::ostream& operator<<(std::ostream& os, const APT::PrettyPkg& pp);
std::ostream& operator<<(std::ostream& os, const APT::PrettyDep& pd);

#endif