diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-06-10 21:24:47 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-06-10 21:24:47 +0200 |
commit | d3a869e35503638e3483228fbfc95b7143568ad0 (patch) | |
tree | d3fa852ba88b4da60e2ec7b6422e756a0dac3f4b /apt-pkg/acquire-item.h | |
parent | 59148d9630bbbd53c6aa10da0fcdbd579797502a (diff) |
store all targets data in IndexTarget struct
We still need an API for the targets, so slowly prepare the IndexTargets
to let them take this job.
Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/acquire-item.h')
-rw-r--r-- | apt-pkg/acquire-item.h | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 38a7a8662..a2571e1cd 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -28,6 +28,7 @@ #include <string> #include <vector> +#include <map> #ifndef APT_8_CLEANER_HEADERS #include <apt-pkg/indexfile.h> @@ -49,7 +50,7 @@ class pkgSourceList; class IndexTarget; class pkgAcqMetaBase; -class APT_HIDDEN IndexTarget /*{{{*/ +class IndexTarget /*{{{*/ /** \brief Information about an index file. */ { public: @@ -63,30 +64,18 @@ class APT_HIDDEN IndexTarget /*{{{*/ std::string const ShortDesc; /** \brief The key by which this index file should be - * looked up within the meta signature file. - */ + looked up within the meta index file. */ std::string const MetaKey; - virtual bool IsOptional() const { - return false; - } + /** \brief Is it okay if the file isn't found in the meta index */ + bool const IsOptional; - IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, - std::string const &LongDesc, std::string const &URI) : - URI(URI), Description(LongDesc), ShortDesc(ShortDesc), MetaKey(MetaKey) {} -}; - /*}}}*/ -class APT_HIDDEN OptionalIndexTarget : public IndexTarget /*{{{*/ -/** \brief Information about an optional index file. */ -{ - public: - virtual bool IsOptional() const { - return true; - } + /** \brief Target specific options defined by the implementation */ + std::map<std::string, std::string> const Options; - OptionalIndexTarget(std::string const &MetaKey, std::string const &ShortDesc, - std::string const &LongDesc, std::string const &URI) : - IndexTarget(MetaKey, ShortDesc, LongDesc, URI) {} + IndexTarget(std::string const &MetaKey, std::string const &ShortDesc, + std::string const &LongDesc, std::string const &URI, bool const IsOptional, + std::map<std::string, std::string> const &Options); }; /*}}}*/ class pkgAcquire::Item : public WeakPointable /*{{{*/ |