1 #ifndef PKGLIB_METAINDEX_H
2 #define PKGLIB_METAINDEX_H
4 #include <apt-pkg/indexfile.h>
5 #include <apt-pkg/init.h>
12 #ifndef APT_10_CLEANER_HEADERS
13 #include <apt-pkg/pkgcache.h>
14 class pkgCacheGenerator
;
17 #ifndef APT_8_CLEANER_HEADERS
18 #include <apt-pkg/srcrecords.h>
19 #include <apt-pkg/pkgrecords.h>
20 #include <apt-pkg/vendor.h>
26 class pkgCacheGenerator
;
32 APT_IGNORE_DEPRECATED_PUSH
35 std::string MetaKeyFilename
;
36 HashStringList Hashes
;
37 unsigned long long Size
;
39 APT_DEPRECATED HashString Hash
;
41 APT_IGNORE_DEPRECATED_POP
43 enum APT_HIDDEN TriState
{
44 TRI_YES
, TRI_DONTCARE
, TRI_NO
, TRI_UNSET
49 std::vector
<pkgIndexFile
*> *Indexes
;
50 // parsed from the sources.list
62 bool SupportsAcquireByHash
;
63 std::map
<std::string
, checkSum
*> Entries
;
64 TriState LoadedSuccessfully
;
68 std::string
GetURI() const;
69 std::string
GetDist() const;
70 const char* GetType() const;
71 TriState
GetTrusted() const;
72 std::string
GetSignedBy() const;
74 std::string
GetCodename() const;
75 std::string
GetSuite() const;
76 bool GetSupportsAcquireByHash() const;
77 time_t GetValidUntil() const;
78 time_t GetDate() const;
80 std::string
GetExpectedDist() const;
81 bool CheckDist(std::string
const &MaybeDist
) const;
83 // Interface for acquire
84 virtual std::string
Describe() const;
85 virtual std::string
ArchiveURI(std::string
const& File
) const = 0;
86 virtual bool GetIndexes(pkgAcquire
*Owner
, bool const &GetAll
=false) = 0;
87 virtual std::vector
<IndexTarget
> GetIndexTargets() const = 0;
88 virtual std::vector
<pkgIndexFile
*> *GetIndexFiles() = 0;
89 virtual bool IsTrusted() const = 0;
90 virtual bool Load(std::string
const &Filename
, std::string
* const ErrorText
) = 0;
91 /** @return a new metaIndex object based on this one, but without information from #Load */
92 virtual metaIndex
* UnloadedClone() const = 0;
93 // the given metaIndex is potentially invalid after this call and should be deleted
94 void swapLoad(metaIndex
* const OldMetaIndex
);
96 // Lookup functions for parsed Hashes
97 checkSum
*Lookup(std::string
const &MetaKey
) const;
98 /** \brief tests if a checksum for this file is available */
99 bool Exists(std::string
const &MetaKey
) const;
100 std::vector
<std::string
> MetaKeys() const;
101 TriState
GetLoadedSuccessfully() const;
103 // Interfaces for pkgCacheGen
104 virtual pkgCache::RlsFileIterator
FindInCache(pkgCache
&Cache
, bool const ModifyCheck
) const;
105 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
108 metaIndex(std::string
const &URI
, std::string
const &Dist
,
109 char const * const Type
);
110 virtual ~metaIndex();