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