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)  

CacheSetHelper Class Reference

#include <cacheset.h>

Inheritance diagram for CacheSetHelper:
[legend]

Classes

struct  PkgModifier
 

Public Types

enum  PkgSelector {
  UNKNOWN , REGEX , TASK , FNMATCH ,
  PACKAGENAME , STRING , PATTERN
}
 
enum  VerSelector {
  RELEASE , VERSIONNUMBER , ALL , CANDANDINST ,
  CANDIDATE , INSTALLED , CANDINST , INSTCAND ,
  NEWEST
}
 specifies which version(s) we want to refer to More...
 

Public Member Functions

 CacheSetHelper (bool const ShowError=true, GlobalError::MsgType ErrorType=GlobalError::ERROR)
 
virtual ~CacheSetHelper ()
 
virtual bool PackageFrom (enum PkgSelector const select, PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string const &pattern)
 
virtual bool PackageFromCommandLine (PackageContainerInterface *const pci, pkgCacheFile &Cache, const char **cmdline)
 
virtual bool PackageFromModifierCommandLine (unsigned short &modID, PackageContainerInterface *const pci, pkgCacheFile &Cache, const char *cmdline, std::list< PkgModifier > const &mods)
 
virtual void showPackageSelection (pkgCache::PkgIterator const &pkg, PkgSelector const select, std::string const &pattern)
 be notified about the package being selected via pattern More...
 
virtual void canNotFindPackage (enum PkgSelector const select, PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string const &pattern)
 be notified if a package can't be found via pattern More...
 
virtual void showVersionSelection (pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const &Ver, enum VerSelector const select, std::string const &pattern)
 be notified about the version being selected via pattern More...
 
virtual void canNotFindVersion (enum VerSelector const select, VersionContainerInterface *const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
 be notified if a version can't be found for a package More...
 
virtual pkgCache::VerIterator canNotGetVersion (enum VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
 
virtual pkgCache::PkgIterator canNotFindPkgName (pkgCacheFile &Cache, std::string const &str)
 
bool showErrors () const
 
bool showErrors (bool const newValue)
 
GlobalError::MsgType errorType () const
 
GlobalError::MsgType errorType (GlobalError::MsgType const &newValue)
 

Protected Member Functions

pkgCache::VerIterator canNotGetInstCandVer (pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
 
pkgCache::VerIterator canNotGetCandInstVer (pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
 
bool PackageFromTask (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern)
 
bool PackageFromRegEx (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern)
 
bool PackageFromFnmatch (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern)
 
bool PackageFromPackageName (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern)
 
bool PackageFromString (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string const &pattern)
 
bool PackageFromPattern (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string const &pattern)
 

Protected Attributes

bool ShowError
 
GlobalError::MsgType ErrorType
 

Private Member Functions

void showTaskSelection (pkgCache::PkgIterator const &pkg, std::string const &pattern)
 
void showRegExSelection (pkgCache::PkgIterator const &pkg, std::string const &pattern)
 
void showFnmatchSelection (pkgCache::PkgIterator const &pkg, std::string const &pattern)
 
void showPatternSelection (pkgCache::PkgIterator const &pkg, std::string const &pattern)
 
void canNotFindTask (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern)
 
void canNotFindRegEx (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern)
 
void canNotFindFnmatch (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern)
 
void canNotFindPackage (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string const &str)
 
void showSelectedVersion (pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver, std::string const &ver, bool const verIsRel)
 
void canNotFindAllVer (VersionContainerInterface *const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
 
void canNotFindInstCandVer (VersionContainerInterface *const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
 
void canNotFindCandInstVer (VersionContainerInterface *const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
 
pkgCache::VerIterator canNotFindNewestVer (pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
 
pkgCache::VerIterator canNotFindCandidateVer (pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
 
pkgCache::VerIterator canNotFindInstalledVer (pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
 

Private Attributes

void *const d
 

Detailed Description

Simple base class with a lot of virtual methods which can be overridden to alter the behavior or the output of the CacheSets.

This helper is passed around by the static methods in the CacheSets and used every time they hit an error condition or something could be printed out.

Definition at line 41 of file cacheset.h.

Member Enumeration Documentation

◆ PkgSelector

Enumerator
UNKNOWN 
REGEX 
TASK 
FNMATCH 
PACKAGENAME 
STRING 
PATTERN 

Definition at line 55 of file cacheset.h.

◆ VerSelector

specifies which version(s) we want to refer to

Enumerator
RELEASE 

by release string

VERSIONNUMBER 

by version number string

ALL 

All versions

CANDANDINST 

Candidate and installed version

CANDIDATE 

Candidate version

INSTALLED 

Installed version

CANDINST 

Candidate or if non installed version

INSTCAND 

Installed or if non candidate version

NEWEST 

Newest version

Definition at line 95 of file cacheset.h.

Constructor & Destructor Documentation

◆ CacheSetHelper()

CacheSetHelper ( bool const  ShowError = true,
GlobalError::MsgType  ErrorType = GlobalError::ERROR 
)

Definition at line 878 of file cacheset.cc.

◆ ~CacheSetHelper()

~CacheSetHelper ( )
virtual

Definition at line 880 of file cacheset.cc.

Member Function Documentation

◆ canNotFindAllVer()

void canNotFindAllVer ( VersionContainerInterface *const  vci,
pkgCacheFile Cache,
pkgCache::PkgIterator const &  Pkg 
)
private

Definition at line 738 of file cacheset.cc.

References CacheSetHelper::ErrorType, and CacheSetHelper::ShowError.

Referenced by CacheSetHelper::canNotFindVersion().

◆ canNotFindCandidateVer()

◆ canNotFindCandInstVer()

void canNotFindCandInstVer ( VersionContainerInterface *const  vci,
pkgCacheFile Cache,
pkgCache::PkgIterator const &  Pkg 
)
private

Definition at line 751 of file cacheset.cc.

References CacheSetHelper::canNotGetCandInstVer().

Referenced by CacheSetHelper::canNotFindVersion().

◆ canNotFindFnmatch()

void canNotFindFnmatch ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string  pattern 
)
private

Definition at line 702 of file cacheset.cc.

References CacheSetHelper::ErrorType, and CacheSetHelper::ShowError.

Referenced by CacheSetHelper::canNotFindPackage().

◆ canNotFindInstalledVer()

◆ canNotFindInstCandVer()

void canNotFindInstCandVer ( VersionContainerInterface *const  vci,
pkgCacheFile Cache,
pkgCache::PkgIterator const &  Pkg 
)
private

Definition at line 745 of file cacheset.cc.

References CacheSetHelper::canNotGetInstCandVer().

Referenced by CacheSetHelper::canNotFindVersion().

◆ canNotFindNewestVer()

◆ canNotFindPackage() [1/2]

void canNotFindPackage ( enum PkgSelector const  select,
PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string const &  pattern 
)
virtual

be notified if a package can't be found via pattern

Can be used to show a message as well as to try something else to make it match

Parameters
selectis the method tried for selection
pciis the container the package should be inserted in
Cacheis the package universe available
patternis the string not matching anything

Definition at line 676 of file cacheset.cc.

References CacheSetHelper::canNotFindFnmatch(), CacheSetHelper::canNotFindRegEx(), CacheSetHelper::canNotFindTask(), CacheSetHelper::FNMATCH, CacheSetHelper::PACKAGENAME, CacheSetHelper::PATTERN, CacheSetHelper::REGEX, CacheSetHelper::STRING, CacheSetHelper::TASK, and CacheSetHelper::UNKNOWN.

Referenced by CacheSetHelper::PackageFromFnmatch(), CacheSetHelper::PackageFromRegEx(), CacheSetHelper::PackageFromString(), and CacheSetHelper::PackageFromTask().

◆ canNotFindPackage() [2/2]

void canNotFindPackage ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string const &  str 
)
private

Definition at line 708 of file cacheset.cc.

◆ canNotFindPkgName()

◆ canNotFindRegEx()

void canNotFindRegEx ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string  pattern 
)
private

Definition at line 696 of file cacheset.cc.

References CacheSetHelper::ErrorType, and CacheSetHelper::ShowError.

Referenced by CacheSetHelper::canNotFindPackage().

◆ canNotFindTask()

void canNotFindTask ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string  pattern 
)
private

Definition at line 690 of file cacheset.cc.

References CacheSetHelper::ErrorType, and CacheSetHelper::ShowError.

Referenced by CacheSetHelper::canNotFindPackage().

◆ canNotFindVersion()

void canNotFindVersion ( enum VerSelector const  select,
VersionContainerInterface *const  vci,
pkgCacheFile Cache,
pkgCache::PkgIterator const &  Pkg 
)
virtual

be notified if a version can't be found for a package

Main use is probably to show a message to the user what happened

Parameters
selectis the method tried for selection
vciis the container the version should be inserted in
Cacheis the package universe available
Pkgis the package we wanted a version from

Reimplemented in CacheSetHelperAPTGet.

Definition at line 721 of file cacheset.cc.

References CacheSetHelper::ALL, CacheSetHelper::CANDANDINST, CacheSetHelper::CANDIDATE, CacheSetHelper::CANDINST, CacheSetHelper::canNotFindAllVer(), CacheSetHelper::canNotFindCandidateVer(), CacheSetHelper::canNotFindCandInstVer(), CacheSetHelper::canNotFindInstalledVer(), CacheSetHelper::canNotFindInstCandVer(), CacheSetHelper::canNotFindNewestVer(), CacheSetHelper::canNotGetCandInstVer(), CacheSetHelper::INSTALLED, CacheSetHelper::INSTCAND, CacheSetHelper::NEWEST, CacheSetHelper::RELEASE, and CacheSetHelper::VERSIONNUMBER.

Referenced by CacheSetHelperAPTGet::canNotFindVersion(), and VersionContainerInterface::FromPackage().

◆ canNotGetCandInstVer()

◆ canNotGetInstCandVer()

◆ canNotGetVersion()

◆ errorType() [1/2]

GlobalError::MsgType errorType ( ) const
inline

Definition at line 149 of file cacheset.h.

◆ errorType() [2/2]

GlobalError::MsgType errorType ( GlobalError::MsgType const &  newValue)
inline

Definition at line 150 of file cacheset.h.

◆ PackageFrom()

◆ PackageFromCommandLine()

bool PackageFromCommandLine ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
const char **  cmdline 
)
virtual

◆ PackageFromFnmatch()

◆ PackageFromModifierCommandLine()

bool PackageFromModifierCommandLine ( unsigned short &  modID,
PackageContainerInterface *const  pci,
pkgCacheFile Cache,
const char *  cmdline,
std::list< PkgModifier > const &  mods 
)
virtual

◆ PackageFromPackageName()

◆ PackageFromPattern()

bool PackageFromPattern ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string const &  pattern 
)
protected

◆ PackageFromRegEx()

◆ PackageFromString()

bool PackageFromString ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string const &  pattern 
)
protected

◆ PackageFromTask()

◆ showErrors() [1/2]

◆ showErrors() [2/2]

bool showErrors ( bool const  newValue)
inline

Definition at line 148 of file cacheset.h.

◆ showFnmatchSelection()

void showFnmatchSelection ( pkgCache::PkgIterator const &  pkg,
std::string const &  pattern 
)
private

Definition at line 839 of file cacheset.cc.

Referenced by CacheSetHelper::showPackageSelection().

◆ showPackageSelection()

void showPackageSelection ( pkgCache::PkgIterator const &  pkg,
PkgSelector const  select,
std::string const &  pattern 
)
virtual

be notified about the package being selected via pattern

Main use is probably to show a message to the user what happened

Parameters
pkgis the package which was selected
selectis the selection method which choose the package
patternis the string used by the selection method to pick the package

Reimplemented in CacheSetHelperAPTGet.

Definition at line 816 of file cacheset.cc.

References CacheSetHelper::FNMATCH, CacheSetHelper::PACKAGENAME, CacheSetHelper::PATTERN, CacheSetHelper::REGEX, CacheSetHelper::showFnmatchSelection(), CacheSetHelper::showPatternSelection(), CacheSetHelper::showRegExSelection(), CacheSetHelper::showTaskSelection(), CacheSetHelper::STRING, CacheSetHelper::TASK, and CacheSetHelper::UNKNOWN.

Referenced by CacheSetHelper::PackageFromFnmatch(), CacheSetHelper::PackageFromRegEx(), CacheSetHelper::PackageFromTask(), and CacheSetHelperAPTGet::showPackageSelection().

◆ showPatternSelection()

void showPatternSelection ( pkgCache::PkgIterator const &  pkg,
std::string const &  pattern 
)
private

Definition at line 844 of file cacheset.cc.

Referenced by CacheSetHelper::showPackageSelection().

◆ showRegExSelection()

void showRegExSelection ( pkgCache::PkgIterator const &  pkg,
std::string const &  pattern 
)
private

Definition at line 834 of file cacheset.cc.

Referenced by CacheSetHelper::showPackageSelection().

◆ showSelectedVersion()

void showSelectedVersion ( pkgCache::PkgIterator const &  Pkg,
pkgCache::VerIterator const  Ver,
std::string const &  ver,
bool const  verIsRel 
)
private

Definition at line 871 of file cacheset.cc.

Referenced by CacheSetHelper::showVersionSelection().

◆ showTaskSelection()

void showTaskSelection ( pkgCache::PkgIterator const &  pkg,
std::string const &  pattern 
)
private

Definition at line 829 of file cacheset.cc.

Referenced by CacheSetHelper::showPackageSelection().

◆ showVersionSelection()

void showVersionSelection ( pkgCache::PkgIterator const &  Pkg,
pkgCache::VerIterator const &  Ver,
enum VerSelector const  select,
std::string const &  pattern 
)
virtual

be notified about the version being selected via pattern

Main use is probably to show a message to the user what happened Note that at the moment this method is only called for RELEASE and VERSION selections, not for the others.

Parameters
Pkgis the package which was selected for
Veris the version selected
selectis the selection method which choose the version
patternis the string used by the selection method to pick the version

Reimplemented in CacheSetHelperAPTGet.

Definition at line 851 of file cacheset.cc.

References CacheSetHelper::ALL, CacheSetHelper::CANDANDINST, CacheSetHelper::CANDIDATE, CacheSetHelper::CANDINST, CacheSetHelper::INSTALLED, CacheSetHelper::INSTCAND, CacheSetHelper::NEWEST, CacheSetHelper::RELEASE, CacheSetHelper::showSelectedVersion(), and CacheSetHelper::VERSIONNUMBER.

Referenced by VersionContainerInterface::FromString(), and CacheSetHelperAPTGet::showVersionSelection().

Member Data Documentation

◆ d

void* const d
private

Definition at line 194 of file cacheset.h.

◆ ErrorType

◆ ShowError


The documentation for this class was generated from the following files: