]>
git.saurik.com Git - apt.git/blob - apt-pkg/pkgrecords.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: pkgrecords.h,v 1.6 2001/03/13 06:51:46 jgg Exp $
4 /* ######################################################################
6 Package Records - Allows access to complete package description records
7 directly from the file.
9 The package record system abstracts the actual parsing of the
10 package files. This is different than the generators parser in that
11 it is used to access information not generate information. No
12 information touched by the generator should be parable from here as
13 it can always be retreived directly from the cache.
15 ##################################################################### */
17 #ifndef PKGLIB_PKGRECORDS_H
18 #define PKGLIB_PKGRECORDS_H
21 #include <apt-pkg/pkgcache.h>
22 #include <apt-pkg/fileutl.h>
33 std::vector
<Parser
*>Files
;
38 Parser
&Lookup(pkgCache::VerFileIterator
const &Ver
);
39 Parser
&Lookup(pkgCache::DescFileIterator
const &Desc
);
42 pkgRecords(pkgCache
&Cache
);
46 class pkgRecords::Parser
50 virtual bool Jump(pkgCache::VerFileIterator
const &Ver
) = 0;
51 virtual bool Jump(pkgCache::DescFileIterator
const &Desc
) = 0;
54 friend class pkgRecords
;
56 // These refer to the archive file for the Version
57 virtual string
FileName() {return string();};
58 virtual string
MD5Hash() {return string();};
59 virtual string
SHA1Hash() {return string();};
60 virtual string
SHA256Hash() {return string();};
61 virtual string
SourcePkg() {return string();};
62 virtual string
SourceVer() {return string();};
64 // These are some general stats about the package
65 virtual string
Maintainer() {return string();};
66 virtual string
ShortDesc() {return string();};
67 virtual string
LongDesc() {return string();};
68 virtual string
Name() {return string();};
69 virtual string
Homepage() {return string();}
71 // The record in binary form
72 virtual void GetRec(const char *&Start
,const char *&Stop
) {Start
= Stop
= 0;};