diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2010-06-06 21:41:27 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2010-06-06 21:41:27 +0200 |
commit | 9cc83a6fbc089ccf9cb8d52ee9f380cf5df62d5c (patch) | |
tree | 739553a52b0abbf5344330fa2c45e0dc7105fbbb /apt-pkg/cacheset.h | |
parent | 07c279d93f0b61e96c9caf8139accd0289feab56 (diff) |
add a GroupedFromCommandLine method to the PackageSet to split the
packages on the commandline into groups based on modifiers
Diffstat (limited to 'apt-pkg/cacheset.h')
-rw-r--r-- | apt-pkg/cacheset.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 0f3a87a3d..c9d121083 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -11,6 +11,8 @@ // Include Files /*{{{*/ #include <iostream> #include <fstream> +#include <list> +#include <map> #include <set> #include <string> @@ -101,6 +103,27 @@ public: /*{{{*/ std::ostream out (std::ofstream("/dev/null").rdbuf()); return APT::PackageSet::FromCommandLine(Cache, cmdline, out); } + + struct Modifier { + enum Position { NONE, PREFIX, POSTFIX }; + unsigned short ID; + const char * const Alias; + Position Pos; + Modifier (unsigned short const &id, const char * const alias, Position const &pos) : ID(id), Alias(alias), Pos(pos) {}; + }; + + static std::map<unsigned short, PackageSet> GroupedFromCommandLine( + pkgCacheFile &Cache, const char **cmdline, + std::list<PackageSet::Modifier> const &mods, + unsigned short const &fallback, std::ostream &out); + static std::map<unsigned short, PackageSet> GroupedFromCommandLine( + pkgCacheFile &Cache, const char **cmdline, + std::list<PackageSet::Modifier> const &mods, + unsigned short const &fallback) { + std::ostream out (std::ofstream("/dev/null").rdbuf()); + return APT::PackageSet::GroupedFromCommandLine(Cache, cmdline, + mods, fallback, out); + } /*}}}*/ }; /*}}}*/ class VersionSet : public std::set<pkgCache::VerIterator> { /*{{{*/ |