]>
git.saurik.com Git - apt.git/blob - apt-pkg/deb/debindexfile.h
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
;
29 class debStatusIndex
: public pkgDebianIndexRealFile
33 virtual std::string
GetArchitecture() const APT_OVERRIDE
;
34 virtual std::string
GetComponent() const APT_OVERRIDE
;
35 virtual uint8_t GetIndexFlags() const APT_OVERRIDE
;
39 virtual const Type
*GetType() const APT_OVERRIDE APT_CONST
;
41 // Interface for the Cache Generator
42 virtual bool HasPackages() const APT_OVERRIDE
{return true;};
43 // Abort if the file does not exist.
44 virtual bool Exists() const APT_OVERRIDE
{return true;};
46 virtual pkgCacheListParser
* CreateListParser(FileFd
&Pkg
) APT_OVERRIDE
;
48 debStatusIndex(std::string
const &File
);
49 virtual ~debStatusIndex();
52 class debPackagesIndex
: public pkgDebianIndexTargetFile
56 virtual uint8_t GetIndexFlags() const APT_OVERRIDE
;
59 virtual const Type
*GetType() const APT_OVERRIDE APT_CONST
;
61 // Stuff for accessing files on remote items
62 virtual std::string
ArchiveInfo(pkgCache::VerIterator
const &Ver
) const APT_OVERRIDE
;
64 // Interface for the Cache Generator
65 virtual bool HasPackages() const APT_OVERRIDE
{return true;};
67 debPackagesIndex(IndexTarget
const &Target
, bool const Trusted
);
68 virtual ~debPackagesIndex();
71 class debTranslationsIndex
: public pkgDebianIndexTargetFile
75 virtual std::string
GetArchitecture() const APT_OVERRIDE
;
76 virtual uint8_t GetIndexFlags() const APT_OVERRIDE
;
77 virtual bool OpenListFile(FileFd
&Pkg
, std::string
const &FileName
) APT_OVERRIDE
;
78 APT_HIDDEN
virtual pkgCacheListParser
* CreateListParser(FileFd
&Pkg
) APT_OVERRIDE
;
82 virtual const Type
*GetType() const APT_OVERRIDE APT_CONST
;
84 // Interface for the Cache Generator
85 virtual bool HasPackages() const APT_OVERRIDE
;
87 debTranslationsIndex(IndexTarget
const &Target
);
88 virtual ~debTranslationsIndex();
91 class debSourcesIndex
: public pkgDebianIndexTargetFile
94 virtual uint8_t GetIndexFlags() const APT_OVERRIDE
;
95 virtual bool OpenListFile(FileFd
&Pkg
, std::string
const &FileName
) APT_OVERRIDE
;
96 APT_HIDDEN
virtual pkgCacheListParser
* CreateListParser(FileFd
&Pkg
) APT_OVERRIDE
;
100 virtual const Type
*GetType() const APT_OVERRIDE APT_CONST
;
102 // Stuff for accessing files on remote items
103 virtual std::string
SourceInfo(pkgSrcRecords::Parser
const &Record
,
104 pkgSrcRecords::File
const &File
) const APT_OVERRIDE
;
106 // Interface for the record parsers
107 virtual pkgSrcRecords::Parser
*CreateSrcParser() const APT_OVERRIDE
;
109 // Interface for the Cache Generator
110 virtual bool HasPackages() const APT_OVERRIDE
{return false;};
112 debSourcesIndex(IndexTarget
const &Target
, bool const Trusted
);
113 virtual ~debSourcesIndex();
116 class debDebPkgFileIndex
: public pkgDebianIndexRealFile
122 virtual std::string
GetComponent() const APT_OVERRIDE
;
123 virtual std::string
GetArchitecture() const APT_OVERRIDE
;
124 virtual uint8_t GetIndexFlags() const APT_OVERRIDE
;
125 virtual bool OpenListFile(FileFd
&Pkg
, std::string
const &FileName
) APT_OVERRIDE
;
126 APT_HIDDEN
virtual pkgCacheListParser
* CreateListParser(FileFd
&Pkg
) APT_OVERRIDE
;
129 virtual const Type
*GetType() const APT_OVERRIDE APT_CONST
;
131 /** get the control (file) content of the deb file
133 * @param[out] content of the control file
134 * @param debfile is the filename of the .deb-file
135 * @return \b true if successful, otherwise \b false.
137 static bool GetContent(std::ostream
&content
, std::string
const &debfile
);
139 // Interface for the Cache Generator
140 virtual bool HasPackages() const APT_OVERRIDE
{return true;}
141 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const APT_OVERRIDE
;
143 // Interface for acquire
145 debDebPkgFileIndex(std::string
const &DebFile
);
146 virtual ~debDebPkgFileIndex();
149 class debDscFileIndex
: public pkgDebianIndexRealFile
153 virtual const Type
*GetType() const APT_OVERRIDE APT_CONST
;
154 virtual pkgSrcRecords::Parser
*CreateSrcParser() const APT_OVERRIDE
;
155 virtual bool HasPackages() const APT_OVERRIDE
{return false;};
157 debDscFileIndex(std::string
const &DscFile
);
158 virtual ~debDscFileIndex();
161 class debDebianSourceDirIndex
: public debDscFileIndex
164 virtual const Type
*GetType() const APT_OVERRIDE APT_CONST
;