summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheset.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/cacheset.h')
-rw-r--r--apt-pkg/cacheset.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h
index 668d8039e..2bc268380 100644
--- a/apt-pkg/cacheset.h
+++ b/apt-pkg/cacheset.h
@@ -209,6 +209,41 @@ public: /*{{{*/
static APT::VersionSet FromCommandLine(pkgCacheFile &Cache, const char **cmdline) {
return APT::VersionSet::FromCommandLine(Cache, cmdline, CANDINST);
}
+
+ static APT::VersionSet FromString(pkgCacheFile &Cache, std::string pkg,
+ APT::VersionSet::Version const &fallback, std::ostream &out);
+ static APT::VersionSet FromString(pkgCacheFile &Cache, std::string pkg,
+ APT::VersionSet::Version const &fallback) {
+ std::ostream out (std::ofstream("/dev/null").rdbuf());
+ return APT::VersionSet::FromString(Cache, pkg, fallback, out);
+ }
+ static APT::VersionSet FromString(pkgCacheFile &Cache, std::string pkg) {
+ return APT::VersionSet::FromString(Cache, pkg, CANDINST);
+ }
+
+ struct Modifier {
+ enum Position { NONE, PREFIX, POSTFIX };
+ unsigned short ID;
+ const char * const Alias;
+ Position Pos;
+ VersionSet::Version SelectVersion;
+ Modifier (unsigned short const &id, const char * const alias, Position const &pos,
+ VersionSet::Version const &select) : ID(id), Alias(alias), Pos(pos),
+ SelectVersion(select) {};
+ };
+
+ static std::map<unsigned short, VersionSet> GroupedFromCommandLine(
+ pkgCacheFile &Cache, const char **cmdline,
+ std::list<VersionSet::Modifier> const &mods,
+ unsigned short const &fallback, std::ostream &out);
+ static std::map<unsigned short, VersionSet> GroupedFromCommandLine(
+ pkgCacheFile &Cache, const char **cmdline,
+ std::list<VersionSet::Modifier> const &mods,
+ unsigned short const &fallback) {
+ std::ostream out (std::ofstream("/dev/null").rdbuf());
+ return APT::VersionSet::GroupedFromCommandLine(Cache, cmdline,
+ mods, fallback, out);
+ }
/*}}}*/
protected: /*{{{*/