libapt-pkg-dev  v0.9.7.5ubuntu5.4
Debian+Ubuntu APT Package Management
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
APT::PackageContainer< Container > Class Template Reference

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. More...

#include <cacheset.h>

Inheritance diagram for APT::PackageContainer< Container >:
Collaboration diagram for APT::PackageContainer< Container >:

Classes

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

Public Types

enum  Constructor {
  UNKNOWN,
  REGEX,
  TASK
}
 

Public Member Functions

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

Static Public Member Functions

static bool FromCommandLine (PackageContainerInterface *const pci, pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper)
 
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 bool FromGroup (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper)
 
static bool FromModifierCommandLine (unsigned short &modID, PackageContainerInterface *const pci, pkgCacheFile &Cache, const char *cmdline, std::list< Modifier > const &mods, CacheSetHelper &helper)
 
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 bool FromRegEx (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper)
 
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 bool FromString (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper)
 
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 bool FromTask (PackageContainerInterface *const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper)
 
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 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)
 

Private Attributes

Container _cont
 
Constructor ConstructedBy
 

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 Enumeration Documentation

Enumerator
UNKNOWN 
REGEX 
TASK 

Constructor & Destructor Documentation

template<class Container>
APT::PackageContainer< Container >::PackageContainer ( )
inline
template<class Container>
APT::PackageContainer< Container >::PackageContainer ( Constructor const &  by)
inline

Member Function Documentation

template<class Container>
const_iterator APT::PackageContainer< Container >::begin ( ) const
inline

References APT::PackageContainer< Container >::_cont.

Referenced by APT::PackageContainer< Container >::insert().

Here is the caller graph for this function:

template<class Container>
iterator APT::PackageContainer< Container >::begin ( )
inline
template<class Container>
void APT::PackageContainer< Container >::clear ( )
inlinevirtual
template<class Container>
bool APT::PackageContainer< Container >::empty ( ) const
inlinevirtual
template<class Container>
const_iterator APT::PackageContainer< Container >::end ( ) const
inline

References APT::PackageContainer< Container >::_cont.

Referenced by APT::PackageContainer< Container >::insert().

Here is the caller graph for this function:

template<class Container>
iterator APT::PackageContainer< Container >::end ( )
inline
template<class Container>
void APT::PackageContainer< Container >::erase ( iterator  position)
inline
template<class Container>
iterator& APT::PackageContainer< Container >::erase ( iterator position,
bool   
)
inline
template<class Container>
size_t APT::PackageContainer< Container >::erase ( const pkgCache::PkgIterator  x)
inline
template<class Container>
void APT::PackageContainer< Container >::erase ( iterator  first,
iterator  last 
)
inline
template<class Container>
const_iterator APT::PackageContainer< Container >::find ( pkgCache::PkgIterator const &  P) const
inline
static bool APT::PackageContainerInterface::FromCommandLine ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
const char **  cmdline,
CacheSetHelper helper 
)
staticinherited

Referenced by APT::PackageContainer< Container >::FromCommandLine().

Here is the caller graph for this function:

template<class Container>
static PackageContainer APT::PackageContainer< Container >::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

References APT::PackageContainerInterface::FromCommandLine().

Referenced by APT::PackageContainer< Container >::FromCommandLine().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Container>
static PackageContainer APT::PackageContainer< Container >::FromCommandLine ( pkgCacheFile Cache,
const char **  cmdline 
)
inlinestatic

References APT::PackageContainer< Container >::FromCommandLine().

Here is the call graph for this function:

static bool APT::PackageContainerInterface::FromGroup ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string  pattern,
CacheSetHelper helper 
)
staticinherited
static bool APT::PackageContainerInterface::FromModifierCommandLine ( unsigned short &  modID,
PackageContainerInterface *const  pci,
pkgCacheFile Cache,
const char *  cmdline,
std::list< Modifier > const &  mods,
CacheSetHelper helper 
)
staticinherited

Referenced by APT::PackageContainer< Container >::GroupedFromCommandLine().

Here is the caller graph for this function:

template<class Container>
static pkgCache::PkgIterator APT::PackageContainer< Container >::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

References APT::PackageContainerInterface::FromName().

Here is the call graph for this function:

template<class Container>
static pkgCache::PkgIterator APT::PackageContainer< Container >::FromName ( pkgCacheFile Cache,
std::string const &  pattern 
)
inlinestatic

References APT::PackageContainerInterface::FromName().

Here is the call graph for this function:

static bool APT::PackageContainerInterface::FromRegEx ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string  pattern,
CacheSetHelper helper 
)
staticinherited

Referenced by APT::PackageContainer< Container >::FromRegEx().

Here is the caller graph for this function:

template<class Container>
static PackageContainer APT::PackageContainer< Container >::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

References APT::PackageContainerInterface::FromRegEx(), and APT::PackageContainerInterface::REGEX.

Referenced by APT::PackageContainer< Container >::FromRegEx().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Container>
static PackageContainer APT::PackageContainer< Container >::FromRegEx ( pkgCacheFile Cache,
std::string const &  pattern 
)
inlinestatic

References APT::PackageContainer< Container >::FromRegEx().

Here is the call graph for this function:

static bool APT::PackageContainerInterface::FromString ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string const &  pattern,
CacheSetHelper helper 
)
staticinherited

Referenced by APT::PackageContainer< Container >::FromString().

Here is the caller graph for this function:

template<class Container>
static PackageContainer APT::PackageContainer< Container >::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

References APT::PackageContainerInterface::FromString().

Referenced by APT::PackageContainer< Container >::FromString().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Container>
static PackageContainer APT::PackageContainer< Container >::FromString ( pkgCacheFile Cache,
std::string const &  pattern 
)
inlinestatic

References APT::PackageContainer< Container >::FromString().

Here is the call graph for this function:

static bool APT::PackageContainerInterface::FromTask ( PackageContainerInterface *const  pci,
pkgCacheFile Cache,
std::string  pattern,
CacheSetHelper helper 
)
staticinherited

Referenced by APT::PackageContainer< Container >::FromTask().

Here is the caller graph for this function:

template<class Container>
static PackageContainer APT::PackageContainer< Container >::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

References APT::PackageContainerInterface::FromTask(), and APT::PackageContainerInterface::TASK.

Referenced by APT::PackageContainer< Container >::FromTask().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Container>
static PackageContainer APT::PackageContainer< Container >::FromTask ( pkgCacheFile Cache,
std::string const &  pattern 
)
inlinestatic

References APT::PackageContainer< Container >::FromTask().

Here is the call graph for this function:

template<class Container>
Constructor APT::PackageContainer< Container >::getConstructor ( ) const
inlinevirtual
template<class Container>
static std::map<unsigned short, PackageContainer> APT::PackageContainer< Container >::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

References APT::PackageContainerInterface::FromModifierCommandLine().

Referenced by APT::PackageContainer< Container >::GroupedFromCommandLine().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class Container>
static std::map<unsigned short, PackageContainer> APT::PackageContainer< Container >::GroupedFromCommandLine ( pkgCacheFile Cache,
const char **  cmdline,
std::list< Modifier > const &  mods,
unsigned short const &  fallback 
)
inlinestatic

References APT::PackageContainer< Container >::GroupedFromCommandLine().

Here is the call graph for this function:

template<class Container>
bool APT::PackageContainer< Container >::insert ( pkgCache::PkgIterator const &  P)
inlinevirtual

Implements APT::PackageContainerInterface.

References APT::PackageContainer< Container >::_cont, and pkgCache::Iterator< Str, Itr >::end().

Here is the call graph for this function:

template<class Container>
template<class Cont >
void APT::PackageContainer< Container >::insert ( PackageContainer< Cont > const &  pkgcont)
inline
template<class Container>
void APT::PackageContainer< Container >::insert ( const_iterator  begin,
const_iterator  end 
)
inline
template<>
void APT::PackageContainer< std::list< pkgCache::PkgIterator > >::insert ( PackageContainer< Cont > const &  pkgcont)

References APT::PackageContainer< Container >::begin(), and APT::PackageContainer< Container >::end().

Here is the call graph for this function:

template<>
bool APT::PackageContainer< std::list< pkgCache::PkgIterator > >::insert ( pkgCache::PkgIterator const &  P)
inlinevirtual

Implements APT::PackageContainerInterface.

References pkgCache::Iterator< Str, Itr >::end().

Here is the call graph for this function:

template<>
void APT::PackageContainer< std::list< pkgCache::PkgIterator > >::insert ( const_iterator  begin,
const_iterator  end 
)
inline
template<class Container>
void APT::PackageContainer< Container >::setConstructor ( Constructor const &  by)
inlinevirtual
template<class Container>
size_t APT::PackageContainer< Container >::size ( ) const
inline

Member Data Documentation


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