apt  0.9.9.1~ubuntu1
Classes | Public Member Functions | Static Public Member Functions | List of all members
PackageContainer< Container > Class Template Reference
Inheritance diagram for PackageContainer< Container >:
PackageContainerInterface

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 More...
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 
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 More...
 
static std::map< unsigned
short, PackageContainer
GroupedFromCommandLine (pkgCacheFile &Cache, const char **cmdline, std::list< Modifier > const &mods, unsigned short const &fallback)
 
- Static Public Member Functions inherited from PackageContainerInterface
static bool FromTask (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper)
 
static bool FromRegEx (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper)
 
static pkgCache::PkgIterator FromName (pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper)
 
static bool FromGroup (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper)
 
static bool FromString (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper)
 
static bool FromCommandLine (PackageContainerInterface *const pci, pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper)
 
static bool FromModifierCommandLine (unsigned short &modID, PackageContainerInterface *const pci, pkgCacheFile &Cache, const char *cmdline, std::list< Modifier > const &mods, CacheSetHelper &helper)
 

Additional Inherited Members

- Public Types inherited from PackageContainerInterface
enum  Constructor { UNKNOWN, REGEX, TASK }
 

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 
)
inlinestatic

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 
)
inlinestatic

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
static PackageContainer FromRegEx ( pkgCacheFile Cache,
std::string  pattern,
CacheSetHelper helper 
)
inlinestatic

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 
)
inlinestatic

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 
)
inlinestatic

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 
)
inlinestatic

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: