1 #ifndef PKGLIB_DEBMETAINDEX_H
2 #define PKGLIB_DEBMETAINDEX_H
4 #include <apt-pkg/metaindex.h>
5 #include <apt-pkg/macros.h>
11 #ifndef APT_8_CLEANER_HEADERS
12 #include <apt-pkg/sourcelist.h>
14 #ifndef APT_10_CLEANER_HEADERS
15 #include <apt-pkg/init.h>
20 class debDebPkgFileIndex
;
22 class pkgCacheGenerator
;
24 class debReleaseIndexPrivate
;
26 class APT_HIDDEN debReleaseIndex
: public metaIndex
28 debReleaseIndexPrivate
* const d
;
30 APT_HIDDEN
bool parseSumData(const char *&Start
, const char *End
, std::string
&Name
,
31 std::string
&Hash
, unsigned long long &Size
);
34 APT_HIDDEN
std::string
MetaIndexInfo(const char *Type
) const;
35 APT_HIDDEN
std::string
MetaIndexFile(const char *Types
) const;
36 APT_HIDDEN
std::string
MetaIndexURI(const char *Type
) const;
38 debReleaseIndex(std::string
const &URI
, std::string
const &Dist
);
39 debReleaseIndex(std::string
const &URI
, std::string
const &Dist
, bool const Trusted
);
40 virtual ~debReleaseIndex();
42 virtual std::string
ArchiveURI(std::string
const &File
) const APT_OVERRIDE
{return URI
+ File
;};
43 virtual bool GetIndexes(pkgAcquire
*Owner
, bool const &GetAll
=false) APT_OVERRIDE
;
44 virtual std::vector
<IndexTarget
> GetIndexTargets() const APT_OVERRIDE
;
46 virtual std::string
Describe() const APT_OVERRIDE
;
47 virtual pkgCache::RlsFileIterator
FindInCache(pkgCache
&Cache
, bool const ModifyCheck
) const APT_OVERRIDE
;
48 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const APT_OVERRIDE
;
50 virtual bool Load(std::string
const &Filename
, std::string
* const ErrorText
) APT_OVERRIDE
;
51 virtual metaIndex
* UnloadedClone() const APT_OVERRIDE
;
53 virtual std::vector
<pkgIndexFile
*> *GetIndexFiles() APT_OVERRIDE
;
55 bool SetTrusted(TriState
const Trusted
);
56 bool SetCheckValidUntil(TriState
const Trusted
);
57 bool SetValidUntilMin(time_t const Valid
);
58 bool SetValidUntilMax(time_t const Valid
);
59 bool SetSignedBy(std::string
const &SignedBy
);
61 virtual bool IsTrusted() const APT_OVERRIDE
;
63 void AddComponent(bool const isSrc
, std::string
const &Name
,
64 std::vector
<std::string
> const &Targets
,
65 std::vector
<std::string
> const &Architectures
,
66 std::vector
<std::string
> Languages
);
69 class APT_HIDDEN debDebFileMetaIndex
: public metaIndex
74 debDebPkgFileIndex
*DebIndex
;
76 virtual std::string
ArchiveURI(std::string
const& /*File*/) const APT_OVERRIDE
{
79 virtual bool GetIndexes(pkgAcquire
* /*Owner*/, const bool& /*GetAll=false*/) APT_OVERRIDE
{
82 virtual std::vector
<IndexTarget
> GetIndexTargets() const APT_OVERRIDE
{
83 return std::vector
<IndexTarget
>();
85 virtual std::vector
<pkgIndexFile
*> *GetIndexFiles() APT_OVERRIDE
{
88 virtual bool IsTrusted() const APT_OVERRIDE
{
91 virtual bool Load(std::string
const &, std::string
* const ErrorText
) APT_OVERRIDE
93 LoadedSuccessfully
= TRI_NO
;
94 if (ErrorText
!= NULL
)
95 strprintf(*ErrorText
, "Unparseable metaindex as it represents the standalone deb file %s", DebFile
.c_str());
98 virtual metaIndex
* UnloadedClone() const APT_OVERRIDE
102 debDebFileMetaIndex(std::string
const &DebFile
);
103 virtual ~debDebFileMetaIndex();