]> git.saurik.com Git - apt.git/blame - apt-pkg/indexrecords.h
* merged apt--no-pragma
[apt.git] / apt-pkg / indexrecords.h
CommitLineData
7db98ffc
MZ
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3// $Id: indexrecords.h,v 1.1.2.1 2003/12/24 23:09:17 mdz Exp $
4 /*}}}*/
5#ifndef PKGLIB_INDEXRECORDS_H
6#define PKGLIB_INDEXRECORDS_H
7
be009af2 8
7db98ffc
MZ
9#include <apt-pkg/pkgcache.h>
10#include <apt-pkg/fileutl.h>
11
12#include <map>
a75c6a6e 13#include <vector>
7db98ffc
MZ
14
15class indexRecords
16{
17 bool parseSumData(const char *&Start, const char *End, string &Name,
18 string &Hash, size_t &Size);
19 public:
20 struct checkSum;
21 string ErrorText;
22
23 protected:
24 string Dist;
25 string Suite;
26 string ExpectedDist;
27 std::map<string,checkSum *> Entries;
28
29 public:
30
31 indexRecords();
32 indexRecords(const string ExpectedDist);
33
34 // Lookup function
35 virtual const checkSum *Lookup(const string MetaKey);
a75c6a6e
MZ
36 std::vector<std::string> MetaKeys();
37
7db98ffc
MZ
38 virtual bool Load(string Filename);
39 string GetDist() const;
40 virtual bool CheckDist(const string MaybeDist) const;
41 string GetExpectedDist() const;
42 virtual ~indexRecords(){};
43};
44
45struct indexRecords::checkSum
46{
47 string MetaKeyFilename;
48 string MD5Hash;
49 size_t Size;
50};
51
52#endif