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 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
50 debStatusIndex(std::string File
);
51 virtual ~debStatusIndex();
54 class APT_HIDDEN debPackagesIndex
: public pkgIndexTargetFile
58 virtual const Type
*GetType() const APT_CONST
;
60 // Stuff for accessing files on remote items
61 virtual std::string
ArchiveInfo(pkgCache::VerIterator Ver
) const;
63 // Interface for the Cache Generator
64 virtual bool HasPackages() const {return true;};
65 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
66 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
68 debPackagesIndex(IndexTarget
const &Target
, bool const Trusted
);
69 virtual ~debPackagesIndex();
72 class APT_HIDDEN debTranslationsIndex
: public pkgIndexTargetFile
76 virtual const Type
*GetType() const APT_CONST
;
78 // Interface for the Cache Generator
79 virtual bool HasPackages() const;
80 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
81 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
83 debTranslationsIndex(IndexTarget
const &Target
);
84 virtual ~debTranslationsIndex();
87 class APT_HIDDEN debSourcesIndex
: public pkgIndexTargetFile
91 virtual const Type
*GetType() const APT_CONST
;
93 // Stuff for accessing files on remote items
94 virtual std::string
SourceInfo(pkgSrcRecords::Parser
const &Record
,
95 pkgSrcRecords::File
const &File
) const;
97 // Interface for the record parsers
98 virtual pkgSrcRecords::Parser
*CreateSrcParser() const;
100 // Interface for the Cache Generator
101 virtual bool HasPackages() const {return false;};
103 debSourcesIndex(IndexTarget
const &Target
, bool const Trusted
);
104 virtual ~debSourcesIndex();
107 class APT_HIDDEN debDebPkgFileIndex
: public pkgIndexFile
112 std::string DebFileFullPath
;
115 virtual const Type
*GetType() const APT_CONST
;
117 virtual std::string
Describe(bool /*Short*/) const {
121 /** get the control (file) content of the deb file
123 * @param[out] content of the control file
124 * @param debfile is the filename of the .deb-file
125 * @return \b true if successful, otherwise \b false.
127 static bool GetContent(std::ostream
&content
, std::string
const &debfile
);
129 // Interface for the Cache Generator
130 virtual bool Exists() const;
131 virtual bool HasPackages() const {
134 virtual unsigned long Size() const;
135 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
136 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
138 // Interface for acquire
139 virtual std::string
ArchiveURI(std::string
/*File*/) const;
141 debDebPkgFileIndex(std::string DebFile
);
142 virtual ~debDebPkgFileIndex();
145 class APT_HIDDEN debDscFileIndex
: public pkgIndexFile
150 virtual const Type
*GetType() const APT_CONST
;
151 virtual pkgSrcRecords::Parser
*CreateSrcParser() const;
152 virtual bool Exists() const;
153 virtual bool HasPackages() const {return false;};
154 virtual unsigned long Size() const;
155 virtual std::string
Describe(bool /*Short*/) const {
159 debDscFileIndex(std::string
&DscFile
);
160 virtual ~debDscFileIndex() {};
163 class APT_HIDDEN debDebianSourceDirIndex
: public debDscFileIndex
166 virtual const Type
*GetType() const APT_CONST
;