remove an extra argument for the error mesage format
[ntk/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>
30257943 22#include <vector>
f55ece0e 23
92fcbfc1 24class pkgRecords /*{{{*/
f55ece0e
AL
25{
26 public:
27 class Parser;
28
29 private:
be9b62f7
MV
30 /** \brief dpointer placeholder (for later in case we need it) */
31 void *d;
f55ece0e
AL
32
33 pkgCache &Cache;
30257943
MV
34 std::vector<Parser *>Files;
35
be9b62f7 36 public:
f55ece0e 37 // Lookup function
03e39e59 38 Parser &Lookup(pkgCache::VerFileIterator const &Ver);
a52f938b 39 Parser &Lookup(pkgCache::DescFileIterator const &Desc);
03e39e59 40
f55ece0e
AL
41 // Construct destruct
42 pkgRecords(pkgCache &Cache);
43 ~pkgRecords();
44};
92fcbfc1
DK
45 /*}}}*/
46class pkgRecords::Parser /*{{{*/
f55ece0e 47{
7e798dd7 48 protected:
f55ece0e 49
03e39e59 50 virtual bool Jump(pkgCache::VerFileIterator const &Ver) = 0;
a52f938b 51 virtual bool Jump(pkgCache::DescFileIterator const &Desc) = 0;
f55ece0e 52
7e798dd7 53 public:
b2e465d6 54 friend class pkgRecords;
7e798dd7
AL
55
56 // These refer to the archive file for the Version
57 virtual string FileName() {return string();};
58 virtual string MD5Hash() {return string();};
a7c835af 59 virtual string SHA1Hash() {return string();};
495e5cb2 60 virtual string SHA256Hash() {return string();};
d9b9e9e2 61 virtual string SHA512Hash() {return string();};
36375005 62 virtual string SourcePkg() {return string();};
c2f2b862 63 virtual string SourceVer() {return string();};
b2e465d6 64
7e798dd7
AL
65 // These are some general stats about the package
66 virtual string Maintainer() {return string();};
67 virtual string ShortDesc() {return string();};
68 virtual string LongDesc() {return string();};
b2e465d6 69 virtual string Name() {return string();};
f27b4a70 70 virtual string Homepage() {return string();}
75bda619
MV
71
72 // An arbitrary custom field
73 virtual string RecordField(const char *fieldName) { return string();};
74
b2e465d6
AL
75 // The record in binary form
76 virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;};
77
f55ece0e
AL
78 virtual ~Parser() {};
79};
92fcbfc1 80 /*}}}*/
f55ece0e 81#endif