diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-07-20 10:17:29 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-08-10 17:27:59 +0200 |
commit | c9443c01208377f0cba9706412ea3a98ad97b56d (patch) | |
tree | e324eb72ee264cc41d92d5c7fc78af77351f6b88 /apt-pkg/pkgcachegen.h | |
parent | 5465192b9aeb1ccea778950ccf2d1b7b32f2cd91 (diff) |
elimate duplicated code in pkgIndexFile subclasses
Trade deduplication of code for a bunch of new virtuals, so it is
actually visible how the different indexes behave cleaning up the
interface at large in the process.
Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/pkgcachegen.h')
-rw-r--r-- | apt-pkg/pkgcachegen.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h index 4b6b91992..15e73627d 100644 --- a/apt-pkg/pkgcachegen.h +++ b/apt-pkg/pkgcachegen.h @@ -32,10 +32,10 @@ class FileFd; class pkgSourceList; class OpProgress; class pkgIndexFile; +class pkgCacheListParser; class APT_HIDDEN pkgCacheGenerator /*{{{*/ { - private: APT_HIDDEN map_stringitem_t WriteStringInMap(std::string const &String) { return WriteStringInMap(String.c_str()); }; APT_HIDDEN map_stringitem_t WriteStringInMap(const char *String); APT_HIDDEN map_stringitem_t WriteStringInMap(const char *String, const unsigned long &Len); @@ -46,10 +46,10 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ std::map<std::string,map_stringitem_t> strPkgNames; std::map<std::string,map_stringitem_t> strVersions; + friend class pkgCacheListParser; + typedef pkgCacheListParser ListParser; + public: - - class ListParser; - friend class ListParser; template<typename Iter> class Dynamic { public: @@ -138,11 +138,12 @@ class APT_HIDDEN pkgCacheGenerator /*{{{*/ }; /*}}}*/ // This is the abstract package list parser class. /*{{{*/ -class APT_HIDDEN pkgCacheGenerator::ListParser +class APT_HIDDEN pkgCacheListParser { pkgCacheGenerator *Owner; friend class pkgCacheGenerator; - + template<class T> using Dynamic = pkgCacheGenerator::Dynamic<T>; + // Some cache items pkgCache::VerIterator OldDepVer; map_pointer_t *OldDepLast; @@ -197,8 +198,8 @@ class APT_HIDDEN pkgCacheGenerator::ListParser virtual bool CollectFileProvides(pkgCache &/*Cache*/, pkgCache::VerIterator &/*Ver*/) {return true;}; - ListParser(); - virtual ~ListParser(); + pkgCacheListParser(); + virtual ~pkgCacheListParser(); }; /*}}}*/ |