]>
git.saurik.com Git - apt.git/blob - apt-pkg/pkgcachegen.h
1385ab964ab9c5c1066df5c0624f804685fa27fd
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: pkgcachegen.h,v 1.1 1998/07/02 02:58:13 jgg Exp $
4 /* ######################################################################
6 Package Cache Generator - Generator for the cache structure.
8 This builds the cache structure from the abstract package list parser.
10 ##################################################################### */
12 // Header section: pkglib
13 #ifndef PKGLIB_PKGCACHEGEN_H
14 #define PKGLIB_PKGCACHEGEN_H
16 #include <pkglib/pkgcache.h>
18 class pkgCacheGenerator
30 pkgCache::PackageFile
*CurrentFile
;
32 bool NewPackage(pkgCache::PkgIterator Pkg
,string Pkg
);
33 bool NewFileVer(pkgCache::VerIterator Ver
,ListParser
&List
);
34 unsigned long NewVersion(pkgCache::VerIterator
&Ver
,unsigned long Next
);
38 // This is the abstract package list parser class.
41 pkgCacheGenerator
*Owner
;
42 friend pkgCacheGenerator
;
46 inline unsigned long WriteString(string S
) {return Owner
->Map
.WriteString(S
);};
47 inline unsigned long WriteString(const char *S
,unsigned int Size
) {return Owner
->Map
.WriteString(S
,Size
);};
51 // These all operate against the current section
52 virtual string
Package() = 0;
53 virtual string
Version() = 0;
54 virtual bool NewVersion(pkgCache::VerIterator Ver
) = 0;
55 virtual bool NewPackage(pkgCache::PkgIterator Pkg
) = 0;
56 virtual bool UsePackage(pkgCache::PkgIterator Pkg
) = 0;
58 virtual bool Step() = 0;
62 bool SelectFile(string File
,unsigned long Flags
= 0);
63 bool MergeList(ListParser
&List
);
65 pkgCacheGenerator(DynamicMMap
&Map
);