]> git.saurik.com Git - apt.git/blame - apt-pkg/indexrecords.h
* test/versions.lst:
[apt.git] / apt-pkg / indexrecords.h
CommitLineData
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
MZ
9#include <apt-pkg/pkgcache.h>
10#include <apt-pkg/fileutl.h>
495e5cb2 11#include <apt-pkg/hashes.h>
7db98ffc
MZ
12
13#include <map>
a75c6a6e 14#include <vector>
1ddb8596 15#include <ctime>
7db98ffc
MZ
16
17class 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;
1ddb8596
DK
29 time_t ValidUntil;
30
7db98ffc
MZ
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);
e1430400
DK
40 /** \brief tests if a checksum for this file is available */
41 bool Exists(string const &MetaKey) const;
a75c6a6e
MZ
42 std::vector<std::string> MetaKeys();
43
7db98ffc
MZ
44 virtual bool Load(string Filename);
45 string GetDist() const;
1ddb8596 46 time_t GetValidUntil() const;
7db98ffc
MZ
47 virtual bool CheckDist(const string MaybeDist) const;
48 string GetExpectedDist() const;
49 virtual ~indexRecords(){};
50};
51
52struct indexRecords::checkSum
53{
54 string MetaKeyFilename;
495e5cb2 55 HashString Hash;
7db98ffc
MZ
56 size_t Size;
57};
58
59#endif