]> git.saurik.com Git - apt.git/blob - apt-pkg/pkgrecords.h
* removed the remaining #ifdef __GNUG__ that are no longer required
[apt.git] / apt-pkg / pkgrecords.h
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 // $Id: pkgrecords.h,v 1.6 2001/03/13 06:51:46 jgg Exp $
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 /*}}}*/
17 #ifndef PKGLIB_PKGRECORDS_H
18 #define PKGLIB_PKGRECORDS_H
19
20
21 #include <apt-pkg/pkgcache.h>
22 #include <apt-pkg/fileutl.h>
23
24 class pkgRecords
25 {
26 public:
27 class Parser;
28
29 private:
30
31 pkgCache &Cache;
32 Parser **Files;
33
34 public:
35
36 // Lookup function
37 Parser &Lookup(pkgCache::VerFileIterator const &Ver);
38
39 // Construct destruct
40 pkgRecords(pkgCache &Cache);
41 ~pkgRecords();
42 };
43
44 class pkgRecords::Parser
45 {
46 protected:
47
48 virtual bool Jump(pkgCache::VerFileIterator const &Ver) = 0;
49
50 public:
51 friend class pkgRecords;
52
53 // These refer to the archive file for the Version
54 virtual string FileName() {return string();};
55 virtual string MD5Hash() {return string();};
56 virtual string SHA1Hash() {return string();};
57 virtual string SourcePkg() {return string();};
58
59 // These are some general stats about the package
60 virtual string Maintainer() {return string();};
61 virtual string ShortDesc() {return string();};
62 virtual string LongDesc() {return string();};
63 virtual string Name() {return string();};
64
65 // The record in binary form
66 virtual void GetRec(const char *&Start,const char *&Stop) {Start = Stop = 0;};
67
68 virtual ~Parser() {};
69 };
70
71 #endif