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 {return File
;};
43 // Interface for the Cache Generator
44 virtual bool Exists() const;
45 virtual bool HasPackages() const {return true;};
46 virtual unsigned long Size() const;
47 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
48 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
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;
64 // Interface for the Cache Generator
65 virtual bool HasPackages() const {return true;};
66 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
67 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
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;
82 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
83 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
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;
100 // Interface for the record parsers
101 virtual pkgSrcRecords::Parser
*CreateSrcParser() const;
103 // Interface for the Cache Generator
104 virtual bool HasPackages() const {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 {
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;
134 virtual bool HasPackages() const {
137 virtual unsigned long Size() const;
138 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
139 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
141 // Interface for acquire
142 virtual std::string
ArchiveURI(std::string
/*File*/) const;
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;
156 virtual bool Exists() const;
157 virtual bool HasPackages() const {return false;};
158 virtual unsigned long Size() const;
159 virtual std::string
Describe(bool /*Short*/) const {
163 debDscFileIndex(std::string
&DscFile
);
164 virtual ~debDscFileIndex();
167 class APT_HIDDEN debDebianSourceDirIndex
: public debDscFileIndex
170 virtual const Type
*GetType() const APT_CONST
;