1 // -*- mode: cpp; mode: fold -*-
2 #ifndef PKGLIB_INDEXRECORDS_H
3 #define PKGLIB_INDEXRECORDS_H
5 #include <apt-pkg/hashes.h>
12 #ifndef APT_8_CLEANER_HEADERS
13 #include <apt-pkg/fileutl.h>
15 #ifndef APT_10_CLEANER_HEADERS
16 #include <apt-pkg/pkgcache.h>
21 APT_HIDDEN
bool parseSumData(const char *&Start
, const char *End
, std::string
&Name
,
22 std::string
&Hash
, unsigned long long &Size
);
25 std::string ErrorText
;
28 enum APT_HIDDEN
{ ALWAYS_TRUSTED
, NEVER_TRUSTED
, CHECK_TRUST
} Trusted
;
29 // dpointer (for later)
35 std::string ExpectedDist
;
38 bool SupportsAcquireByHash
;
40 std::map
<std::string
,checkSum
*> Entries
;
43 explicit indexRecords(const std::string
&ExpectedDist
= "");
46 virtual checkSum
*Lookup(std::string
const &MetaKey
);
47 /** \brief tests if a checksum for this file is available */
48 bool Exists(std::string
const &MetaKey
) const;
49 std::vector
<std::string
> MetaKeys();
51 virtual bool Load(std::string
const &Filename
);
52 virtual bool CheckDist(std::string
const &MaybeDist
) const;
54 std::string
GetDist() const;
55 std::string
GetSuite() const;
56 bool GetSupportsAcquireByHash() const;
57 time_t GetValidUntil() const;
58 time_t GetDate() const;
59 std::string
GetExpectedDist() const;
61 /** \brief check if source is marked as always trusted */
62 bool IsAlwaysTrusted() const;
63 /** \brief check if source is marked as never trusted */
64 bool IsNeverTrusted() const;
66 /** \brief sets an explicit trust value
68 * \b true means that the source should always be considered trusted,
69 * while \b false marks a source as always untrusted, even if we have
70 * a valid signature and everything.
72 void SetTrusted(bool const Trusted
);
74 virtual ~indexRecords();
77 APT_IGNORE_DEPRECATED_PUSH
78 struct indexRecords::checkSum
80 std::string MetaKeyFilename
;
81 HashStringList Hashes
;
82 unsigned long long Size
;
84 APT_DEPRECATED HashString Hash
;
86 APT_IGNORE_DEPRECATED_POP