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