1 // -*- mode: cpp; mode: fold -*-
3 // $Id: indexrecords.h,v 1.1.2.1 2003/12/24 23:09:17 mdz Exp $
5 #ifndef PKGLIB_INDEXRECORDS_H
6 #define PKGLIB_INDEXRECORDS_H
8 #include <apt-pkg/hashes.h>
15 #ifndef APT_8_CLEANER_HEADERS
16 #include <apt-pkg/fileutl.h>
18 #ifndef APT_10_CLEANER_HEADERS
19 #include <apt-pkg/pkgcache.h>
24 bool parseSumData(const char *&Start
, const char *End
, std::string
&Name
,
25 std::string
&Hash
, unsigned long long &Size
);
28 std::string ErrorText
;
29 // dpointer (for later9
35 std::string ExpectedDist
;
37 bool SupportsAcquireByHash
;
39 std::map
<std::string
,checkSum
*> Entries
;
44 indexRecords(const std::string ExpectedDist
);
47 virtual checkSum
*Lookup(const std::string MetaKey
);
48 /** \brief tests if a checksum for this file is available */
49 bool Exists(std::string
const &MetaKey
) const;
50 std::vector
<std::string
> MetaKeys();
52 virtual bool Load(std::string Filename
);
53 std::string
GetDist() const;
54 std::string
GetSuite() const;
55 bool GetSupportsAcquireByHash() const;
56 time_t GetValidUntil() const;
57 virtual bool CheckDist(const std::string MaybeDist
) const;
58 std::string
GetExpectedDist() const;
59 virtual ~indexRecords(){};
63 // ensure that con- & de-structor don't trigger this warning
64 #pragma GCC diagnostic push
65 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
67 struct indexRecords::checkSum
69 std::string MetaKeyFilename
;
70 HashStringList Hashes
;
71 unsigned long long Size
;
73 APT_DEPRECATED HashString Hash
;
76 #pragma GCC diagnostic pop