]> git.saurik.com Git - apt.git/blob - apt-pkg/indexrecords.h
use the Valid-Until header from the Release file but if the user
[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
9 #include <apt-pkg/pkgcache.h>
10 #include <apt-pkg/fileutl.h>
11 #include <apt-pkg/hashes.h>
12
13 #include <map>
14 #include <vector>
15 #include <ctime>
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 time_t ValidUntil;
30
31 std::map<string,checkSum *> Entries;
32
33 public:
34
35 indexRecords();
36 indexRecords(const string ExpectedDist);
37
38 // Lookup function
39 virtual const checkSum *Lookup(const string MetaKey);
40 std::vector<std::string> MetaKeys();
41
42 virtual bool Load(string Filename);
43 string GetDist() const;
44 time_t GetValidUntil() const;
45 virtual bool CheckDist(const string MaybeDist) const;
46 string GetExpectedDist() const;
47 virtual ~indexRecords(){};
48 };
49
50 struct indexRecords::checkSum
51 {
52 string MetaKeyFilename;
53 HashString Hash;
54 size_t Size;
55 };
56
57 #endif