1 // -*- mode: cpp; mode: fold -*-
3 // $Id: debindexfile.h,v 1.3.2.1 2003/12/24 23:09:17 mdz Exp $
4 /* ######################################################################
8 There are three sorts currently
10 Package files that have File: tags
11 Package files that don't (/var/lib/dpkg/status)
14 ##################################################################### */
16 #ifndef PKGLIB_DEBINDEXFILE_H
17 #define PKGLIB_DEBINDEXFILE_H
19 #include <apt-pkg/indexfile.h>
20 #include <apt-pkg/cacheiterators.h>
21 #include <apt-pkg/pkgcache.h>
22 #include <apt-pkg/srcrecords.h>
28 class pkgCacheGenerator
;
31 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 bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
, unsigned long const Flag
) const;
49 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
51 debStatusIndex(std::string File
);
52 virtual ~debStatusIndex();
55 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
77 virtual const Type
*GetType() const APT_CONST
;
79 // Interface for the Cache Generator
80 virtual bool HasPackages() const;
81 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
82 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
84 debTranslationsIndex(IndexTarget
const &Target
);
85 virtual ~debTranslationsIndex();
88 class APT_HIDDEN debSourcesIndex
: public pkgIndexTargetFile
92 virtual const Type
*GetType() const APT_CONST
;
94 // Stuff for accessing files on remote items
95 virtual std::string
SourceInfo(pkgSrcRecords::Parser
const &Record
,
96 pkgSrcRecords::File
const &File
) const;
98 // Interface for the record parsers
99 virtual pkgSrcRecords::Parser
*CreateSrcParser() const;
101 // Interface for the Cache Generator
102 virtual bool HasPackages() const {return false;};
104 debSourcesIndex(IndexTarget
const &Target
, bool const Trusted
);
105 virtual ~debSourcesIndex();
108 class APT_HIDDEN debDebPkgFileIndex
: public pkgIndexFile
113 std::string DebFileFullPath
;
116 virtual const Type
*GetType() const APT_CONST
;
118 virtual std::string
Describe(bool /*Short*/) const {
122 /** get the control (file) content of the deb file
124 * @param[out] content of the control file
125 * @param debfile is the filename of the .deb-file
126 * @return \b true if successful, otherwise \b false.
128 static bool GetContent(std::ostream
&content
, std::string
const &debfile
);
130 // Interface for the Cache Generator
131 virtual bool Exists() const;
132 virtual bool HasPackages() const {
135 virtual unsigned long Size() const;
136 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
137 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
139 // Interface for acquire
140 virtual std::string
ArchiveURI(std::string
/*File*/) const;
142 debDebPkgFileIndex(std::string DebFile
);
143 virtual ~debDebPkgFileIndex();
146 class APT_HIDDEN debDscFileIndex
: public pkgIndexFile
151 virtual const Type
*GetType() const APT_CONST
;
152 virtual pkgSrcRecords::Parser
*CreateSrcParser() const;
153 virtual bool Exists() const;
154 virtual bool HasPackages() const {return false;};
155 virtual unsigned long Size() const;
156 virtual std::string
Describe(bool /*Short*/) const {
160 debDscFileIndex(std::string
&DscFile
);
161 virtual ~debDscFileIndex() {};
164 class APT_HIDDEN debDebianSourceDirIndex
: public debDscFileIndex
167 virtual const Type
*GetType() const APT_CONST
;