]> git.saurik.com Git - apt.git/blame - apt-pkg/pkgrecords.h
* merged some more missing bits
[apt.git] / apt-pkg / pkgrecords.h
CommitLineData
f55ece0e
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
a7c835af 3// $Id: pkgrecords.h,v 1.6 2001/03/13 06:51:46 jgg Exp $
f55ece0e
AL
4/* ######################################################################
5
6 Package Records - Allows access to complete package description records
7 directly from the file.
8
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.
14
15 ##################################################################### */
16 /*}}}*/
f55ece0e
AL
17#ifndef PKGLIB_PKGRECORDS_H
18#define PKGLIB_PKGRECORDS_H
19
f55ece0e
AL
20
21#include <apt-pkg/pkgcache.h>
22#include <apt-pkg/fileutl.h>
23
24class pkgRecords
25{
26 public:
27 class Parser;
28
29 private:
30
31 pkgCache &Cache;
b2e465d6
AL
32 Parser **Files;
33
f55ece0e
AL
34 public:
35
36 // Lookup function
03e39e59 37 Parser &Lookup(pkgCache::VerFileIterator const &Ver);
a52f938b 38 Parser &Lookup(pkgCache::DescFileIterator const &Desc);
03e39e59 39
f55ece0e
AL
40 // Construct destruct
41 pkgRecords(pkgCache &Cache);
42 ~pkgRecords();
43};
44
45class pkgRecords::Parser
46{
7e798dd7 47 protected:
f55ece0e 48
03e39e59 49 virtual bool Jump(pkgCache::VerFileIterator const &Ver) = 0;
a52f938b 50 virtual bool Jump(pkgCache::DescFileIterator const &Desc) = 0;
f55ece0e 51
7e798dd7 52 public:
b2e465d6 53 friend class pkgRecords;
7e798dd7
AL
54
55 // These refer to the archive file for the Version
56 virtual string FileName() {return string();};
57 virtual string MD5Hash() {return string();};
a7c835af 58 virtual string SHA1Hash() {return string();};
36375005 59 virtual string SourcePkg() {return string();};
c2f2b862 60 virtual string SourceVer() {return string();};
b2e465d6 61
7e798dd7
AL
62 // These are some general stats about the package
63 virtual string Maintainer() {return string();};
64 virtual string ShortDesc() {return string();};
65 virtual string LongDesc() {return string();};
b2e465d6
AL
66 virtual string Name() {return string();};
67
68 // The record in binary form
69 virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;};
70
f55ece0e
AL
71 virtual ~Parser() {};
72};
73
74#endif