1 // -*- mode: cpp; mode: fold -*-
3 /* ######################################################################
7 There are three sorts currently
9 Package files that have File: tags
10 Package files that don't (/var/lib/dpkg/status)
13 ##################################################################### */
15 #ifndef PKGLIB_DEBINDEXFILE_H
16 #define PKGLIB_DEBINDEXFILE_H
18 #include <apt-pkg/indexfile.h>
19 #include <apt-pkg/cacheiterators.h>
20 #include <apt-pkg/pkgcache.h>
21 #include <apt-pkg/srcrecords.h>
27 class pkgCacheGenerator
;
30 class APT_HIDDEN debStatusIndex
: public pkgIndexFile
38 virtual const Type
*GetType() const APT_CONST
;
40 // Interface for acquire
41 virtual std::string
Describe(bool /*Short*/) const APT_OVERRIDE
{return File
;};
43 // Interface for the Cache Generator
44 virtual bool Exists() const APT_OVERRIDE
;
45 virtual bool HasPackages() const APT_OVERRIDE
{return true;};
46 virtual unsigned long Size() const APT_OVERRIDE
;
47 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const APT_OVERRIDE
;
48 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const APT_OVERRIDE
;
50 debStatusIndex(std::string File
);
51 virtual ~debStatusIndex();
54 class APT_HIDDEN debPackagesIndex
: public pkgIndexTargetFile
59 virtual const Type
*GetType() const APT_CONST
;
61 // Stuff for accessing files on remote items
62 virtual std::string
ArchiveInfo(pkgCache::VerIterator Ver
) const APT_OVERRIDE
;
64 // Interface for the Cache Generator
65 virtual bool HasPackages() const APT_OVERRIDE
{return true;};
66 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const APT_OVERRIDE
;
67 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const APT_OVERRIDE
;
69 debPackagesIndex(IndexTarget
const &Target
, bool const Trusted
);
70 virtual ~debPackagesIndex();
73 class APT_HIDDEN debTranslationsIndex
: public pkgIndexTargetFile
78 virtual const Type
*GetType() const APT_CONST
;
80 // Interface for the Cache Generator
81 virtual bool HasPackages() const APT_OVERRIDE
;
82 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const APT_OVERRIDE
;
83 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const APT_OVERRIDE
;
85 debTranslationsIndex(IndexTarget
const &Target
);
86 virtual ~debTranslationsIndex();
89 class APT_HIDDEN debSourcesIndex
: public pkgIndexTargetFile
94 virtual const Type
*GetType() const APT_CONST
;
96 // Stuff for accessing files on remote items
97 virtual std::string
SourceInfo(pkgSrcRecords::Parser
const &Record
,
98 pkgSrcRecords::File
const &File
) const APT_OVERRIDE
;
100 // Interface for the record parsers
101 virtual pkgSrcRecords::Parser
*CreateSrcParser() const APT_OVERRIDE
;
103 // Interface for the Cache Generator
104 virtual bool HasPackages() const APT_OVERRIDE
{return false;};
106 debSourcesIndex(IndexTarget
const &Target
, bool const Trusted
);
107 virtual ~debSourcesIndex();
110 class APT_HIDDEN debDebPkgFileIndex
: public pkgIndexFile
115 std::string DebFileFullPath
;
118 virtual const Type
*GetType() const APT_CONST
;
120 virtual std::string
Describe(bool /*Short*/) const APT_OVERRIDE
{
124 /** get the control (file) content of the deb file
126 * @param[out] content of the control file
127 * @param debfile is the filename of the .deb-file
128 * @return \b true if successful, otherwise \b false.
130 static bool GetContent(std::ostream
&content
, std::string
const &debfile
);
132 // Interface for the Cache Generator
133 virtual bool Exists() const APT_OVERRIDE
;
134 virtual bool HasPackages() const APT_OVERRIDE
{
137 virtual unsigned long Size() const APT_OVERRIDE
;
138 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const APT_OVERRIDE
;
139 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const APT_OVERRIDE
;
141 // Interface for acquire
142 virtual std::string
ArchiveURI(std::string
/*File*/) const APT_OVERRIDE
;
144 debDebPkgFileIndex(std::string DebFile
);
145 virtual ~debDebPkgFileIndex();
148 class APT_HIDDEN debDscFileIndex
: public pkgIndexFile
154 virtual const Type
*GetType() const APT_CONST
;
155 virtual pkgSrcRecords::Parser
*CreateSrcParser() const APT_OVERRIDE
;
156 virtual bool Exists() const APT_OVERRIDE
;
157 virtual bool HasPackages() const APT_OVERRIDE
{return false;};
158 virtual unsigned long Size() const APT_OVERRIDE
;
159 virtual std::string
Describe(bool /*Short*/) const APT_OVERRIDE
{
163 debDscFileIndex(std::string
&DscFile
);
164 virtual ~debDscFileIndex();
167 class APT_HIDDEN debDebianSourceDirIndex
: public debDscFileIndex
170 virtual const Type
*GetType() const APT_CONST
;