~ubuntu-branches/ubuntu/trusty/apt/trusty

« back to all changes in this revision

Viewing changes to apt-pkg/pkgcachegen.h

  • Committer: Package Import Robot
  • Author(s): Michael Vogt
  • Date: 2014-04-01 17:48:58 UTC
  • mfrom: (1.4.87 sid)
  • Revision ID: package-import@ubuntu.com-20140401174858-4mv29mm29zu22fn1
Tags: 1.0.1ubuntu1
merge with the debian/sid 1.0.1 version
(LP: #1302033)

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef PKGLIB_PKGCACHEGEN_H
20
20
#define PKGLIB_PKGCACHEGEN_H
21
21
 
22
 
 
 
22
#include <apt-pkg/md5.h>
 
23
#include <apt-pkg/mmap.h>
23
24
#include <apt-pkg/pkgcache.h>
24
 
#include <apt-pkg/md5.h>
 
25
#include <apt-pkg/cacheiterators.h>
25
26
#include <apt-pkg/macros.h>
26
27
 
27
28
#include <vector>
 
29
#include <string>
28
30
 
 
31
class FileFd;
29
32
class pkgSourceList;
30
33
class OpProgress;
31
 
class MMap;
32
34
class pkgIndexFile;
33
35
 
34
36
class pkgCacheGenerator                                                 /*{{{*/
36
38
   private:
37
39
 
38
40
   pkgCache::StringItem *UniqHash[26];
39
 
   map_ptrloc WriteStringInMap(std::string const &String) { return WriteStringInMap(String.c_str()); };
40
 
   map_ptrloc WriteStringInMap(const char *String);
41
 
   map_ptrloc WriteStringInMap(const char *String, const unsigned long &Len);
42
 
   map_ptrloc AllocateInMap(const unsigned long &size);
 
41
   APT_HIDDEN map_ptrloc WriteStringInMap(std::string const &String) { return WriteStringInMap(String.c_str()); };
 
42
   APT_HIDDEN map_ptrloc WriteStringInMap(const char *String);
 
43
   APT_HIDDEN map_ptrloc WriteStringInMap(const char *String, const unsigned long &Len);
 
44
   APT_HIDDEN map_ptrloc AllocateInMap(const unsigned long &size);
43
45
 
44
46
   public:
45
47
   
80
82
   bool NewDepends(pkgCache::PkgIterator &Pkg, pkgCache::VerIterator &Ver,
81
83
                   map_ptrloc const Version, unsigned int const &Op,
82
84
                   unsigned int const &Type, map_ptrloc* &OldDepLast);
83
 
   __deprecated unsigned long NewVersion(pkgCache::VerIterator &Ver,const std::string &VerStr,unsigned long Next)
 
85
   unsigned long NewVersion(pkgCache::VerIterator &Ver,const std::string &VerStr,unsigned long Next) APT_DEPRECATED
84
86
   { return NewVersion(Ver, VerStr, 0, 0, Next); }
85
87
   unsigned long NewVersion(pkgCache::VerIterator &Ver,const std::string &VerStr,
86
88
                            map_ptrloc const ParentPkg, unsigned long const Hash,
102
104
 
103
105
   bool HasFileDeps() {return FoundFileDeps;};
104
106
   bool MergeFileProvides(ListParser &List);
105
 
   __deprecated bool FinishCache(OpProgress *Progress);
 
107
   bool FinishCache(OpProgress *Progress) APT_DEPRECATED APT_CONST;
106
108
 
107
109
   static bool MakeStatusCache(pkgSourceList &List,OpProgress *Progress,
108
110
                        MMap **OutMap = 0,bool AllowMem = false);
115
117
   ~pkgCacheGenerator();
116
118
 
117
119
   private:
118
 
   bool MergeListGroup(ListParser &List, std::string const &GrpName);
119
 
   bool MergeListPackage(ListParser &List, pkgCache::PkgIterator &Pkg);
120
 
   bool MergeListVersion(ListParser &List, pkgCache::PkgIterator &Pkg,
 
120
   APT_HIDDEN bool MergeListGroup(ListParser &List, std::string const &GrpName);
 
121
   APT_HIDDEN bool MergeListPackage(ListParser &List, pkgCache::PkgIterator &Pkg);
 
122
   APT_HIDDEN bool MergeListVersion(ListParser &List, pkgCache::PkgIterator &Pkg,
121
123
                         std::string const &Version, pkgCache::VerIterator* &OutVer);
122
124
 
123
 
   bool AddImplicitDepends(pkgCache::GrpIterator &G, pkgCache::PkgIterator &P,
 
125
   APT_HIDDEN bool AddImplicitDepends(pkgCache::GrpIterator &G, pkgCache::PkgIterator &P,
124
126
                           pkgCache::VerIterator &V);
125
 
   bool AddImplicitDepends(pkgCache::VerIterator &V, pkgCache::PkgIterator &D);
 
127
   APT_HIDDEN bool AddImplicitDepends(pkgCache::VerIterator &V, pkgCache::PkgIterator &D);
126
128
};
127
129
                                                                        /*}}}*/
128
130
// This is the abstract package list parser class.                      /*{{{*/
162
164
   virtual std::string DescriptionLanguage() = 0;
163
165
   virtual MD5SumValue Description_md5() = 0;
164
166
   virtual unsigned short VersionHash() = 0;
 
167
   /** compare currently parsed version with given version
 
168
    *
 
169
    * \param Hash of the currently parsed version
 
170
    * \param Ver to compare with
 
171
    */
 
172
#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
 
173
   virtual
 
174
#endif
 
175
      APT_PURE bool SameVersion(unsigned short const Hash, pkgCache::VerIterator const &Ver);
165
176
   virtual bool UsePackage(pkgCache::PkgIterator &Pkg,
166
177
                           pkgCache::VerIterator &Ver) = 0;
167
178
   virtual unsigned long Offset() = 0;
170
181
   virtual bool Step() = 0;
171
182
   
172
183
   inline bool HasFileDeps() {return FoundFileDeps;};
173
 
   virtual bool CollectFileProvides(pkgCache &Cache,
174
 
                                    pkgCache::VerIterator &Ver) {return true;};
 
184
   virtual bool CollectFileProvides(pkgCache &/*Cache*/,
 
185
                                    pkgCache::VerIterator &/*Ver*/) {return true;};
175
186
 
176
187
   ListParser() : FoundFileDeps(false) {};
177
188
   virtual ~ListParser() {};