apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

private-output.cc File Reference
#include <config.h>
#include <apt-pkg/cachefile.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/depcache.h>
#include <apt-pkg/error.h>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/pkgrecords.h>
#include <apt-pkg/policy.h>
#include <apt-pkg/strutl.h>
#include <apt-private/private-cachefile.h>
#include <apt-private/private-output.h>
#include <iomanip>
#include <iostream>
#include <langinfo.h>
#include <regex.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <sstream>
#include <apti18n.h>
Include dependency graph for private-output.cc:

Go to the source code of this file.

Classes

struct  PrettyFullNameWithDue
 

Functions

std::ostream c0out (0)
 
std::ostream c1out (0)
 
std::ostream c2out (0)
 
std::ofstream devnull ("/dev/null")
 
static void SigWinch (int)
 
bool InitOutput (std::basic_streambuf< char > *const out)
 
static std::string GetArchiveSuite (pkgCacheFile &, pkgCache::VerIterator ver)
 
static std::string GetFlagsStr (pkgCacheFile &CacheFile, pkgCache::PkgIterator P)
 
static std::string GetCandidateVersion (pkgCacheFile &CacheFile, pkgCache::PkgIterator P)
 
static std::string GetInstalledVersion (pkgCacheFile &, pkgCache::PkgIterator P)
 
static std::string GetVersion (pkgCacheFile &, pkgCache::VerIterator V)
 
static std::string GetArchitecture (pkgCacheFile &CacheFile, pkgCache::PkgIterator P)
 
static std::string GetShortDescription (pkgCacheFile &CacheFile, pkgRecords &records, pkgCache::PkgIterator P)
 
static std::string GetLongDescription (pkgCacheFile &CacheFile, pkgRecords &records, pkgCache::PkgIterator P)
 
void ListSingleVersion (pkgCacheFile &CacheFile, pkgRecords &records, pkgCache::VerIterator const &V, std::ostream &out, std::string const &format)
 
static void ShowBrokenPackage (ostream &out, pkgCacheFile *const Cache, pkgCache::PkgIterator const &Pkg, bool const Now)
 
void ShowBroken (ostream &out, CacheFile &Cache, bool const Now)
 
void ShowBroken (ostream &out, pkgCacheFile &Cache, bool const Now)
 
void ShowNew (ostream &out, CacheFile &Cache)
 
void ShowDel (ostream &out, CacheFile &Cache)
 
void ShowKept (ostream &out, CacheFile &Cache)
 
void ShowUpgraded (ostream &out, CacheFile &Cache)
 
bool ShowDowngraded (ostream &out, CacheFile &Cache)
 
bool ShowHold (ostream &out, CacheFile &Cache)
 
bool ShowEssential (ostream &out, CacheFile &Cache)
 
void Stats (ostream &out, pkgDepCache &Dep)
 
bool YnPrompt (char const *const Question, bool const Default, bool const ShowGlobalErrors, std::ostream &c1o, std::ostream &c2o)
 
bool YnPrompt (char const *const Question, bool const Default)
 
bool AnalPrompt (std::string const &Question, const char *Text)
 
std::string PrettyFullName (pkgCache::PkgIterator const &Pkg)
 
std::string CandidateVersion (pkgCacheFile *const Cache, pkgCache::PkgIterator const &Pkg)
 
std::function< std::string(pkgCache::PkgIterator const &)> CandidateVersion (pkgCacheFile *const Cache)
 
std::string CurrentToCandidateVersion (pkgCacheFile *const Cache, pkgCache::PkgIterator const &Pkg)
 
std::function< std::string(pkgCache::PkgIterator const &)> CurrentToCandidateVersion (pkgCacheFile *const Cache)
 
bool AlwaysTrue (pkgCache::PkgIterator const &)
 
std::string EmptyString (pkgCache::PkgIterator const &)
 

Variables

unsigned int ScreenWidth = 80 - 1
 

Function Documentation

◆ AlwaysTrue()

bool AlwaysTrue ( pkgCache::PkgIterator const &  )

◆ AnalPrompt()

bool AnalPrompt ( std::string const &  Question,
const char *  Text 
)

Definition at line 757 of file private-output.cc.

References _config, c2out(), and GlobalError::DEBUG.

Referenced by InstallPackages().

◆ c0out()

std::ostream c0out ( )

Referenced by InitOutput().

◆ c1out()

std::ostream c1out ( )

Referenced by InitOutput(), and YnPrompt().

◆ c2out()

std::ostream c2out ( )

Referenced by AnalPrompt(), InitOutput(), and YnPrompt().

◆ CandidateVersion() [1/2]

std::function<std::string(pkgCache::PkgIterator const &)> CandidateVersion ( pkgCacheFile *const  Cache)

Definition at line 781 of file private-output.cc.

References CandidateVersion(), and pkgCache< Str, Itr >::PkgIterator().

◆ CandidateVersion() [2/2]

std::string CandidateVersion ( pkgCacheFile *const  Cache,
pkgCache::PkgIterator const &  Pkg 
)

Definition at line 777 of file private-output.cc.

Referenced by CandidateVersion(), DoAutomaticRemove(), DoInstall(), ShowDel(), and ShowNew().

◆ CurrentToCandidateVersion() [1/2]

std::function<std::string(pkgCache::PkgIterator const &)> CurrentToCandidateVersion ( pkgCacheFile *const  Cache)

◆ CurrentToCandidateVersion() [2/2]

std::string CurrentToCandidateVersion ( pkgCacheFile *const  Cache,
pkgCache::PkgIterator const &  Pkg 
)

◆ devnull()

std::ofstream devnull ( "/dev/null"  )

Referenced by InitOutput().

◆ EmptyString()

std::string EmptyString ( pkgCache::PkgIterator const &  )

◆ GetArchitecture()

static std::string GetArchitecture ( pkgCacheFile CacheFile,
pkgCache::PkgIterator  P 
)
static

◆ GetArchiveSuite()

static std::string GetArchiveSuite ( pkgCacheFile ,
pkgCache::VerIterator  ver 
)
static

Definition at line 111 of file private-output.cc.

References pkgCache< Str, Itr >::VerFileIterator().

Referenced by ListSingleVersion().

◆ GetCandidateVersion()

static std::string GetCandidateVersion ( pkgCacheFile CacheFile,
pkgCache::PkgIterator  P 
)
static

◆ GetFlagsStr()

◆ GetInstalledVersion()

static std::string GetInstalledVersion ( pkgCacheFile ,
pkgCache::PkgIterator  P 
)
static

Definition at line 155 of file private-output.cc.

References pkgCache< Str, Itr >::VerIterator().

Referenced by ListSingleVersion().

◆ GetLongDescription()

◆ GetShortDescription()

◆ GetVersion()

static std::string GetVersion ( pkgCacheFile ,
pkgCache::VerIterator  V 
)
static

◆ InitOutput()

bool InitOutput ( std::basic_streambuf< char > *const  out)

Definition at line 56 of file private-output.cc.

References _config, c0out(), c1out(), c2out(), devnull(), ScreenWidth, and SigWinch().

Referenced by main().

◆ ListSingleVersion()

◆ PrettyFullName()

◆ ShowBroken() [1/2]

void ShowBroken ( ostream &  out,
CacheFile Cache,
bool const  Now 
)

◆ ShowBroken() [2/2]

void ShowBroken ( ostream &  out,
pkgCacheFile Cache,
bool const  Now 
)

Definition at line 456 of file private-output.cc.

References pkgDepCache::BrokenCount(), and ShowBrokenPackage().

◆ ShowBrokenPackage()

static void ShowBrokenPackage ( ostream &  out,
pkgCacheFile *const  Cache,
pkgCache::PkgIterator const &  Pkg,
bool const  Now 
)
static

◆ ShowDel()

void ShowDel ( ostream &  out,
CacheFile Cache 
)

◆ ShowDowngraded()

bool ShowDowngraded ( ostream &  out,
CacheFile Cache 
)

◆ ShowEssential()

◆ ShowHold()

bool ShowHold ( ostream &  out,
CacheFile Cache 
)

◆ ShowKept()

void ShowKept ( ostream &  out,
CacheFile Cache 
)

◆ ShowNew()

void ShowNew ( ostream &  out,
CacheFile Cache 
)

◆ ShowUpgraded()

void ShowUpgraded ( ostream &  out,
CacheFile Cache 
)

◆ SigWinch()

static void SigWinch ( int  )
static

Definition at line 45 of file private-output.cc.

References ScreenWidth.

Referenced by InitOutput().

◆ Stats()

◆ YnPrompt() [1/2]

bool YnPrompt ( char const *const  Question,
bool const  Default 
)

Definition at line 749 of file private-output.cc.

References c1out(), c2out(), and YnPrompt().

◆ YnPrompt() [2/2]

bool YnPrompt ( char const *const  Question,
bool const  Default,
bool const  ShowGlobalErrors,
std::ostream &  c1o,
std::ostream &  c2o 
)

Variable Documentation

◆ ScreenWidth

unsigned int ScreenWidth = 80 - 1

Definition at line 40 of file private-output.cc.

Referenced by DoUpdate(), InitOutput(), ShowList(), and SigWinch().