Fixed or handling bug
[ntk/apt.git] / apt-pkg / pkgrecords.h
CommitLineData
f55ece0e
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
36375005 3// $Id: pkgrecords.h,v 1.4 1999/04/07 05:30:17 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 /*}}}*/
17// Header section: pkglib
18#ifndef PKGLIB_PKGRECORDS_H
19#define PKGLIB_PKGRECORDS_H
20
21#ifdef __GNUG__
22#pragma interface "apt-pkg/pkgrecords.h"
23#endif
24
25#include <apt-pkg/pkgcache.h>
26#include <apt-pkg/fileutl.h>
27
28class pkgRecords
29{
30 public:
31 class Parser;
32
33 private:
34
35 pkgCache &Cache;
36
37 // List of package files
38 struct PkgFile
39 {
40 FileFd *File;
41 Parser *Parse;
42
43 PkgFile() : File(0), Parse(0) {};
44 ~PkgFile();
45 };
46 PkgFile *Files;
47
48 public:
49
50 // Lookup function
03e39e59
AL
51 Parser &Lookup(pkgCache::VerFileIterator const &Ver);
52
f55ece0e
AL
53 // Construct destruct
54 pkgRecords(pkgCache &Cache);
55 ~pkgRecords();
56};
57
58class pkgRecords::Parser
59{
7e798dd7 60 protected:
f55ece0e 61
03e39e59 62 virtual bool Jump(pkgCache::VerFileIterator const &Ver) = 0;
f55ece0e 63
7e798dd7
AL
64 public:
65 friend pkgRecords;
66
67 // These refer to the archive file for the Version
68 virtual string FileName() {return string();};
69 virtual string MD5Hash() {return string();};
36375005 70 virtual string SourcePkg() {return string();};
7e798dd7
AL
71
72 // These are some general stats about the package
73 virtual string Maintainer() {return string();};
74 virtual string ShortDesc() {return string();};
75 virtual string LongDesc() {return string();};
36375005 76
f55ece0e
AL
77 virtual ~Parser() {};
78};
79
80#endif