]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cacheset.h
* apt-pkg/cacheset.cc:
[apt.git] / apt-pkg / cacheset.h
index 4f7be4caa4875ff2491f6685ca203f77537af03b..668d8039e0254a134a01135112ab0e74201650af 100644 (file)
@@ -11,6 +11,8 @@
 // Include Files                                                       /*{{{*/
 #include <iostream>
 #include <fstream>
+#include <list>
+#include <map>
 #include <set>
 #include <string>
 
@@ -59,7 +61,7 @@ public:                                                                       /*{{{*/
                };
        };
        // 103. set::iterator is required to be modifiable, but this allows modification of keys
-       typedef typename APT::PackageSet::const_iterator iterator;
+       typedef APT::PackageSet::const_iterator iterator;
 
        using std::set<pkgCache::PkgIterator>::insert;
        inline void insert(pkgCache::PkgIterator const &P) { if (P.end() == false) std::set<pkgCache::PkgIterator>::insert(P); };
@@ -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> {            /*{{{*/
@@ -146,7 +169,7 @@ public:                                                                     /*{{{*/
                inline pkgCache::VerFileIterator NewestFile() const { return (**this).NewestFile(); };
        };
        // 103. set::iterator is required to be modifiable, but this allows modification of keys
-       typedef typename APT::VersionSet::const_iterator iterator;
+       typedef APT::VersionSet::const_iterator iterator;
 
        using std::set<pkgCache::VerIterator>::insert;
        inline void insert(pkgCache::VerIterator const &V) { if (V.end() == false) std::set<pkgCache::VerIterator>::insert(V); };
@@ -205,6 +228,11 @@ protected:                                                         /*{{{*/
        static pkgCache::VerIterator getInstalledVer(pkgCacheFile &Cache,
                pkgCache::PkgIterator const &Pkg, bool const &AllowError = false);
 
+
+       static bool AddSelectedVersion(pkgCacheFile &Cache, VersionSet &verset,
+               pkgCache::PkgIterator const &P, VersionSet::Version const &fallback,
+               bool const &AllowError = false);
+
                                                                        /*}}}*/
 };                                                                     /*}}}*/
 }