]> git.saurik.com Git - apt.git/blob - apt-pkg/indexrecords.h
allow SHA1Summation to process a file descriptor until EOF
[apt.git] / apt-pkg / indexrecords.h
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
8 #ifdef __GNUG__
9 #pragma interface "apt-pkg/indexrecords.h"
10 #endif
11 #include <apt-pkg/pkgcache.h>
12 #include <apt-pkg/fileutl.h>
13
14 #include <map>
15
16 class indexRecords
17 {
18 bool parseSumData(const char *&Start, const char *End, string &Name,
19 string &Hash, size_t &Size);
20 public:
21 struct checkSum;
22 string ErrorText;
23
24 protected:
25 string Dist;
26 string Suite;
27 string ExpectedDist;
28 std::map<string,checkSum *> Entries;
29
30 public:
31
32 indexRecords();
33 indexRecords(const string ExpectedDist);
34
35 // Lookup function
36 virtual const checkSum *Lookup(const string MetaKey);
37
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
45 struct indexRecords::checkSum
46 {
47 string MetaKeyFilename;
48 string MD5Hash;
49 size_t Size;
50 };
51
52 #endif