]> git.saurik.com Git - apt.git/blob - apt-pkg/indexrecords.h
66b84f8bb050d844343eab3efec737c4620c5f4d
[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, std::string &Name,
20 std::string &Hash, unsigned long long &Size);
21 public:
22 struct checkSum;
23 std::string ErrorText;
24
25 protected:
26 std::string Dist;
27 std::string Suite;
28 std::string ExpectedDist;
29 time_t ValidUntil;
30
31 std::map<std::string,checkSum *> Entries;
32
33 public:
34
35 indexRecords();
36 indexRecords(const std::string ExpectedDist);
37
38 // Lookup function
39 virtual const checkSum *Lookup(const std::string MetaKey);
40 /** \brief tests if a checksum for this file is available */
41 bool Exists(std::string const &MetaKey) const;
42 std::vector<std::string> MetaKeys();
43
44 virtual bool Load(std::string Filename);
45 std::string GetDist() const;
46 time_t GetValidUntil() const;
47 virtual bool CheckDist(const std::string MaybeDist) const;
48 std::string GetExpectedDist() const;
49 virtual ~indexRecords(){};
50 };
51
52 struct indexRecords::checkSum
53 {
54 std::string MetaKeyFilename;
55 HashString Hash;
56 unsigned long long Size;
57 };
58
59 #endif