]>
Commit | Line | Data |
---|---|---|
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 | ||
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> | |
a75c6a6e | 15 | #include <vector> |
7db98ffc MZ |
16 | |
17 | class indexRecords | |
18 | { | |
19 | bool parseSumData(const char *&Start, const char *End, string &Name, | |
20 | string &Hash, size_t &Size); | |
21 | public: | |
22 | struct checkSum; | |
23 | string ErrorText; | |
24 | ||
25 | protected: | |
26 | string Dist; | |
27 | string Suite; | |
28 | string ExpectedDist; | |
29 | std::map<string,checkSum *> Entries; | |
30 | ||
31 | public: | |
32 | ||
33 | indexRecords(); | |
34 | indexRecords(const string ExpectedDist); | |
35 | ||
36 | // Lookup function | |
37 | virtual const checkSum *Lookup(const string MetaKey); | |
a75c6a6e MZ |
38 | std::vector<std::string> MetaKeys(); |
39 | ||
7db98ffc MZ |
40 | virtual bool Load(string Filename); |
41 | string GetDist() const; | |
42 | virtual bool CheckDist(const string MaybeDist) const; | |
43 | string GetExpectedDist() const; | |
44 | virtual ~indexRecords(){}; | |
45 | }; | |
46 | ||
47 | struct indexRecords::checkSum | |
48 | { | |
49 | string MetaKeyFilename; | |
50 | string MD5Hash; | |
51 | size_t Size; | |
52 | }; | |
53 | ||
54 | #endif |