Package Record parser
[ntk/apt.git] / apt-pkg / pkgrecords.h
CommitLineData
f55ece0e
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3// $Id: pkgrecords.h,v 1.1 1998/08/09 00:51:35 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// 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
51 Parser &Lookup(pkgCache::VerFileIterator &Ver);
52
53 // Construct destruct
54 pkgRecords(pkgCache &Cache);
55 ~pkgRecords();
56};
57
58class pkgRecords::Parser
59{
60 public:
61
62 virtual bool Jump(pkgCache::VerFileIterator &Ver) = 0;
63
64 virtual ~Parser() {};
65};
66
67#endif