]>
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 | ||
be009af2 | 8 | |
7db98ffc | 9 | #include <apt-pkg/pkgcache.h> |
495e5cb2 | 10 | #include <apt-pkg/hashes.h> |
7db98ffc MZ |
11 | |
12 | #include <map> | |
a75c6a6e | 13 | #include <vector> |
1ddb8596 | 14 | #include <ctime> |
7db98ffc | 15 | |
b9dadc24 DK |
16 | #ifndef APT_8_CLEANER_HEADERS |
17 | #include <apt-pkg/fileutl.h> | |
18 | #endif | |
19 | ||
7db98ffc MZ |
20 | class indexRecords |
21 | { | |
8f3ba4e8 DK |
22 | bool parseSumData(const char *&Start, const char *End, std::string &Name, |
23 | std::string &Hash, unsigned long long &Size); | |
7db98ffc MZ |
24 | public: |
25 | struct checkSum; | |
8f3ba4e8 | 26 | std::string ErrorText; |
7db98ffc MZ |
27 | |
28 | protected: | |
8f3ba4e8 DK |
29 | std::string Dist; |
30 | std::string Suite; | |
31 | std::string ExpectedDist; | |
1ddb8596 DK |
32 | time_t ValidUntil; |
33 | ||
8f3ba4e8 | 34 | std::map<std::string,checkSum *> Entries; |
7db98ffc MZ |
35 | |
36 | public: | |
37 | ||
38 | indexRecords(); | |
8f3ba4e8 | 39 | indexRecords(const std::string ExpectedDist); |
7db98ffc MZ |
40 | |
41 | // Lookup function | |
8f3ba4e8 | 42 | virtual const checkSum *Lookup(const std::string MetaKey); |
e1430400 | 43 | /** \brief tests if a checksum for this file is available */ |
8f3ba4e8 | 44 | bool Exists(std::string const &MetaKey) const; |
a75c6a6e MZ |
45 | std::vector<std::string> MetaKeys(); |
46 | ||
8f3ba4e8 DK |
47 | virtual bool Load(std::string Filename); |
48 | std::string GetDist() const; | |
1ddb8596 | 49 | time_t GetValidUntil() const; |
8f3ba4e8 DK |
50 | virtual bool CheckDist(const std::string MaybeDist) const; |
51 | std::string GetExpectedDist() const; | |
7db98ffc MZ |
52 | virtual ~indexRecords(){}; |
53 | }; | |
54 | ||
55 | struct indexRecords::checkSum | |
56 | { | |
8f3ba4e8 | 57 | std::string MetaKeyFilename; |
495e5cb2 | 58 | HashString Hash; |
650faab0 | 59 | unsigned long long Size; |
7db98ffc MZ |
60 | }; |
61 | ||
62 | #endif |