From 9cc83a6fbc089ccf9cb8d52ee9f380cf5df62d5c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 6 Jun 2010 21:41:27 +0200 Subject: add a GroupedFromCommandLine method to the PackageSet to split the packages on the commandline into groups based on modifiers --- apt-pkg/cacheset.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'apt-pkg/cacheset.h') 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 #include +#include +#include #include #include @@ -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 GroupedFromCommandLine( + pkgCacheFile &Cache, const char **cmdline, + std::list const &mods, + unsigned short const &fallback, std::ostream &out); + static std::map GroupedFromCommandLine( + pkgCacheFile &Cache, const char **cmdline, + std::list 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 { /*{{{*/ -- cgit v1.2.3