apt  1.5
Classes | Public Member Functions | Static Public Member Functions
PackageContainer< Container > Class Template Reference
Inheritance diagram for PackageContainer< Container >:
Inheritance graph
[legend]
Collaboration diagram for PackageContainer< Container >:
Collaboration graph
[legend]

List of all members.

Classes

class  const_iterator
 smell like a pkgCache::PkgIterator More...
class  iterator

Public Member Functions

bool insert (pkgCache::PkgIterator const &P)
template<class Cont >
void insert (PackageContainer< Cont > const &pkgcont)
void insert (const_iterator begin, const_iterator end)
bool empty () const
void clear ()
void erase (iterator position)
iteratorerase (iterator &position, bool)
size_t erase (const pkgCache::PkgIterator x)
void erase (iterator first, iterator last)
size_t size () const
const_iterator begin () const
const_iterator end () const
iterator begin ()
iterator end ()
const_iterator find (pkgCache::PkgIterator const &P) const
void setConstructor (Constructor const &by)
Constructor getConstructor () const
 PackageContainer (Constructor const &by)
template<>
void insert (PackageContainer< Cont > const &pkgcont)
template<>
bool insert (pkgCache::PkgIterator const &P)
template<>
void insert (const_iterator begin, const_iterator end)

Static Public Member Functions

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

Detailed Description

template<class Container>
class APT::PackageContainer< Container >

Simple wrapper around a container class like 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

static PackageContainer FromCommandLine ( pkgCacheFile Cache,
const char **  cmdline,
CacheSetHelper helper 
) [inline, 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
static pkgCache::PkgIterator FromName ( pkgCacheFile Cache,
std::string const &  pattern,
CacheSetHelper helper 
) [inline, static]

returns a package specified by a string

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

Reimplemented from PackageContainerInterface.

static PackageContainer FromRegEx ( pkgCacheFile Cache,
std::string  pattern,
CacheSetHelper helper 
) [inline, 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
static PackageContainer FromString ( pkgCacheFile Cache,
std::string const &  pattern,
CacheSetHelper helper 
) [inline, static]

returns all packages specified by a string

Parameters:
Cachethe packages are in
patternString the package name(s) should be extracted from
helperresponsible for error and message handling
static PackageContainer FromTask ( pkgCacheFile Cache,
std::string const &  pattern,
CacheSetHelper helper 
) [inline, 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
static std::map<unsigned short, PackageContainer> GroupedFromCommandLine ( pkgCacheFile Cache,
const char **  cmdline,
std::list< Modifier > const &  mods,
unsigned short const &  fallback,
CacheSetHelper helper 
) [inline, 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

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