-
- // This is the abstract package list parser class.
- class ListParser
- {
- pkgCacheGenerator *Owner;
- friend pkgCacheGenerator;
-
- protected:
-
- inline unsigned long WriteUniqString(string S) {return Owner->WriteUniqString(S);};
- inline unsigned long WriteUniqString(const char *S,unsigned int Size) {return Owner->WriteUniqString(S,Size);};
- inline unsigned long WriteString(string S) {return Owner->Map.WriteString(S);};
- inline unsigned long WriteString(const char *S,unsigned int Size) {return Owner->Map.WriteString(S,Size);};
- bool NewDepends(pkgCache::VerIterator Ver,string Package,
- string Version,unsigned int Op,
- unsigned int Type);
- bool NewProvides(pkgCache::VerIterator Ver,string Package,string Version);
-
- public:
-
- // These all operate against the current section
- virtual string Package() = 0;
- virtual string Version() = 0;
- virtual bool NewVersion(pkgCache::VerIterator Ver) = 0;
- virtual bool UsePackage(pkgCache::PkgIterator Pkg,
- pkgCache::VerIterator Ver) = 0;
- virtual unsigned long Offset() = 0;
- virtual unsigned long Size() = 0;
+
+ unsigned long WriteUniqString(const char *S,unsigned int Size);
+ inline unsigned long WriteUniqString(const string &S) {return WriteUniqString(S.c_str(),S.length());};
+
+ void DropProgress() {Progress = 0;};
+ bool SelectFile(const string &File,const string &Site,pkgIndexFile const &Index,
+ unsigned long Flags = 0);
+ bool MergeList(ListParser &List,pkgCache::VerIterator *Ver = 0);
+ inline pkgCache &GetCache() {return Cache;};
+ inline pkgCache::PkgFileIterator GetCurFile()
+ {return pkgCache::PkgFileIterator(Cache,CurrentFile);};
+
+ bool HasFileDeps() {return FoundFileDeps;};
+ bool MergeFileProvides(ListParser &List);