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>
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) |
iterator & | erase (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 |
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.
|
inherited |
|
inline |
|
inline |
|
inline |
References APT::PackageContainer< Container >::_cont.
Referenced by APT::PackageContainer< Container >::insert().
|
inline |
References APT::PackageContainer< Container >::_cont.
|
inlinevirtual |
Implements APT::PackageContainerInterface.
References APT::PackageContainer< Container >::_cont.
|
inlinevirtual |
Implements APT::PackageContainerInterface.
References APT::PackageContainer< Container >::_cont.
|
inline |
References APT::PackageContainer< Container >::_cont.
Referenced by APT::PackageContainer< Container >::insert().
|
inline |
References APT::PackageContainer< Container >::_cont.
|
inline |
References APT::PackageContainer< Container >::_cont.
|
inline |
References APT::PackageContainer< Container >::_cont.
|
inline |
References APT::PackageContainer< Container >::_cont.
|
inline |
References APT::PackageContainer< Container >::_cont.
|
inline |
References APT::PackageContainer< Container >::_cont.
|
staticinherited |
Referenced by APT::PackageContainer< Container >::FromCommandLine().
|
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.
Cache | the packages are in |
cmdline | Command line the package names should be extracted from |
helper | responsible for error and message handling |
References APT::PackageContainerInterface::FromCommandLine().
Referenced by APT::PackageContainer< Container >::FromCommandLine().
|
inlinestatic |
References APT::PackageContainer< Container >::FromCommandLine().
|
staticinherited |
|
staticinherited |
Referenced by APT::PackageContainer< Container >::GroupedFromCommandLine().
|
inlinestatic |
returns a package specified by a string
Cache | the package is in |
pattern | String the package name should be extracted from |
helper | responsible for error and message handling |
References APT::PackageContainerInterface::FromName().
|
inlinestatic |
|
staticinherited |
Referenced by APT::PackageContainer< Container >::FromRegEx().
|
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.
Cache | the packages are in |
pattern | regular expression for package names |
helper | responsible for error and message handling |
References APT::PackageContainerInterface::FromRegEx(), and APT::PackageContainerInterface::REGEX.
Referenced by APT::PackageContainer< Container >::FromRegEx().
|
inlinestatic |
References APT::PackageContainer< Container >::FromRegEx().
|
staticinherited |
Referenced by APT::PackageContainer< Container >::FromString().
|
inlinestatic |
returns all packages specified by a string
Cache | the packages are in |
pattern | String the package name(s) should be extracted from |
helper | responsible for error and message handling |
References APT::PackageContainerInterface::FromString().
Referenced by APT::PackageContainer< Container >::FromString().
|
inlinestatic |
References APT::PackageContainer< Container >::FromString().
|
staticinherited |
Referenced by APT::PackageContainer< Container >::FromTask().
|
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.
Cache | the packages are in |
pattern | name of the task |
helper | responsible for error and message handling |
References APT::PackageContainerInterface::FromTask(), and APT::PackageContainerInterface::TASK.
Referenced by APT::PackageContainer< Container >::FromTask().
|
inlinestatic |
References APT::PackageContainer< Container >::FromTask().
|
inlinevirtual |
Implements APT::PackageContainerInterface.
References APT::PackageContainer< Container >::ConstructedBy.
|
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.
Cache | the packages are in |
cmdline | Command line the package names should be extracted from |
mods | list of modifiers the method should accept |
fallback | the default modifier group for a package |
helper | responsible for error and message handling |
References APT::PackageContainerInterface::FromModifierCommandLine().
Referenced by APT::PackageContainer< Container >::GroupedFromCommandLine().
|
inlinestatic |
References APT::PackageContainer< Container >::GroupedFromCommandLine().
|
inlinevirtual |
Implements APT::PackageContainerInterface.
References APT::PackageContainer< Container >::_cont, and pkgCache::Iterator< Str, Itr >::end().
|
inline |
References APT::PackageContainer< Container >::_cont, APT::PackageContainer< Container >::begin(), and APT::PackageContainer< Container >::end().
|
inline |
References APT::PackageContainer< Container >::_cont.
void APT::PackageContainer< std::list< pkgCache::PkgIterator > >::insert | ( | PackageContainer< Cont > const & | pkgcont | ) |
References APT::PackageContainer< Container >::begin(), and APT::PackageContainer< Container >::end().
|
inlinevirtual |
Implements APT::PackageContainerInterface.
References pkgCache::Iterator< Str, Itr >::end().
|
inline |
|
inlinevirtual |
Implements APT::PackageContainerInterface.
References APT::PackageContainer< Container >::ConstructedBy.
|
inline |
References APT::PackageContainer< Container >::_cont.
|
private |
Referenced by APT::PackageContainer< Container >::begin(), APT::PackageContainer< Container >::clear(), APT::PackageContainer< Container >::empty(), APT::PackageContainer< Container >::end(), APT::PackageContainer< Container >::erase(), APT::PackageContainer< Container >::find(), APT::PackageContainer< Container >::insert(), and APT::PackageContainer< Container >::size().
|
private |