apt @VERSION@
Classes | Public Types | Public Member Functions | Static Public Member Functions

PackageSet Class Reference

Inherits std::set< pkgCache::PkgIterator >.

List of all members.

Classes

class  const_iterator
 smell like a pkgCache::PkgIterator More...
struct  Modifier

Public Types

enum  Constructor { UNKNOWN, REGEX, TASK }
typedef
APT::PackageSet::const_iterator 
iterator

Public Member Functions

void insert (pkgCache::PkgIterator const &P)
void insert (PackageSet const &pkgset)
Constructor getConstructor () const
 PackageSet (Constructor const &by)

Static Public Member Functions

static APT::PackageSet FromTask (pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper)
 returns all packages in the cache who belong to the given task
static APT::PackageSet FromTask (pkgCacheFile &Cache, std::string const &pattern)
static APT::PackageSet FromRegEx (pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper)
 returns all packages in the cache whose name matchs a given pattern
static APT::PackageSet FromRegEx (pkgCacheFile &Cache, std::string const &pattern)
static APT::PackageSet FromString (pkgCacheFile &Cache, std::string const &string, CacheSetHelper &helper)
 returns all packages specified by a string
static APT::PackageSet FromString (pkgCacheFile &Cache, std::string const &string)
static pkgCache::PkgIterator FromName (pkgCacheFile &Cache, std::string const &string, CacheSetHelper &helper)
 returns a package specified by a string
static pkgCache::PkgIterator FromName (pkgCacheFile &Cache, std::string const &string)
static APT::PackageSet FromCommandLine (pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper)
 returns all packages specified on the commandline
static APT::PackageSet FromCommandLine (pkgCacheFile &Cache, const char **cmdline)
static std::map< unsigned
short, PackageSet
GroupedFromCommandLine (pkgCacheFile &Cache, const char **cmdline, std::list< PackageSet::Modifier > const &mods, unsigned short const &fallback, CacheSetHelper &helper)
 group packages by a action modifiers
static std::map< unsigned
short, PackageSet
GroupedFromCommandLine (pkgCacheFile &Cache, const char **cmdline, std::list< PackageSet::Modifier > const &mods, unsigned short const &fallback)

Detailed Description

Simple wrapper around a std::set to provide a similar interface to a set of packages as to the complete set of all packages in the pkgCache.


Member Function Documentation

PackageSet FromCommandLine ( pkgCacheFile Cache,
const char **  cmdline,
CacheSetHelper helper 
) [static]

returns all packages specified on the commandline

Get all package names from the commandline and executes regex's if needed. No special package command is supported, just plain names.

Parameters:
Cachethe packages are in
cmdlineCommand line the package names should be extracted from
helperresponsible for error and message handling

References PackageSet::FromString().

pkgCache::PkgIterator FromName ( pkgCacheFile Cache,
std::string const &  string,
CacheSetHelper helper 
) [static]

returns a package specified by a string

Parameters:
Cachethe package is in
stringString the package name should be extracted from
helperresponsible for error and message handling

References pkgCache::GrpIterator::FindPreferredPkg().

Referenced by PackageSet::FromString(), and PackageSet::GroupedFromCommandLine().

PackageSet FromRegEx ( pkgCacheFile Cache,
std::string  pattern,
CacheSetHelper helper 
) [static]

returns all packages in the cache whose name matchs a given pattern

A simple helper responsible for executing a regular expression on all package names in the cache. Optional it prints a a notice about the packages chosen cause of the given package.

Parameters:
Cachethe packages are in
patternregular expression for package names
helperresponsible for error and message handling

References Configuration::getArchitectures().

Referenced by PackageSet::FromString().

PackageSet FromString ( pkgCacheFile Cache,
std::string const &  string,
CacheSetHelper helper 
) [static]

returns all packages specified by a string

Parameters:
Cachethe packages are in
stringString the package name(s) should be extracted from
helperresponsible for error and message handling

References PackageSet::FromName(), PackageSet::FromRegEx(), and PackageSet::FromTask().

Referenced by PackageSet::FromCommandLine(), and PackageSet::GroupedFromCommandLine().

PackageSet FromTask ( pkgCacheFile Cache,
std::string  pattern,
CacheSetHelper helper 
) [static]

returns all packages in the cache who belong to the given task

A simple helper responsible for search for all members of a task in the cache. Optional it prints a a notice about the packages chosen cause of the given task.

Parameters:
Cachethe packages are in
patternname of the task
helperresponsible for error and message handling

Referenced by PackageSet::FromString().

std::map< unsigned short, PackageSet > GroupedFromCommandLine ( pkgCacheFile Cache,
const char **  cmdline,
std::list< PackageSet::Modifier > const &  mods,
unsigned short const &  fallback,
CacheSetHelper helper 
) [static]

group packages by a action modifiers

At some point it is needed to get from the same commandline different package sets grouped by a modifier. Take apt-get install apt awesome- as an example.

Parameters:
Cachethe packages are in
cmdlineCommand line the package names should be extracted from
modslist of modifiers the method should accept
fallbackthe default modifier group for a package
helperresponsible for error and message handling

References PackageSet::FromName(), and PackageSet::FromString().


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