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 APT_HIDDEN
bool parseSumData(const char *&Start
, const char *End
, std::string
&Name
,
25 std::string
&Hash
, unsigned long long &Size
);
28 std::string ErrorText
;
31 enum APT_HIDDEN
{ ALWAYS_TRUSTED
, NEVER_TRUSTED
, CHECK_TRUST
} Trusted
;
32 // dpointer (for later)
38 std::string ExpectedDist
;
41 bool SupportsAcquireByHash
;
43 std::map
<std::string
,checkSum
*> Entries
;
46 #if APT_PKG_ABI >= 413
47 indexRecords(const std::string
&ExpectedDist
= "");
50 indexRecords(const std::string ExpectedDist
);
54 virtual checkSum
*Lookup(const std::string MetaKey
);
55 /** \brief tests if a checksum for this file is available */
56 bool Exists(std::string
const &MetaKey
) const;
57 std::vector
<std::string
> MetaKeys();
59 virtual bool Load(std::string Filename
);
60 virtual bool CheckDist(const std::string MaybeDist
) const;
62 std::string
GetDist() const;
63 std::string
GetSuite() const;
64 bool GetSupportsAcquireByHash() const;
65 time_t GetValidUntil() const;
66 time_t GetDate() const;
67 std::string
GetExpectedDist() const;
69 /** \brief check if source is marked as always trusted */
70 bool IsAlwaysTrusted() const;
71 /** \brief check if source is marked as never trusted */
72 bool IsNeverTrusted() const;
74 /** \brief sets an explicit trust value
76 * \b true means that the source should always be considered trusted,
77 * while \b false marks a source as always untrusted, even if we have
78 * a valid signature and everything.
80 void SetTrusted(bool const Trusted
);
82 virtual ~indexRecords();
85 APT_IGNORE_DEPRECATED_PUSH
86 struct indexRecords::checkSum
88 std::string MetaKeyFilename
;
89 HashStringList Hashes
;
90 unsigned long long Size
;
92 APT_DEPRECATED HashString Hash
;
94 APT_IGNORE_DEPRECATED_POP