]>
git.saurik.com Git - apt.git/blob - apt-pkg/deb/debindexfile.h
02708b558ef0db152ec350dc7dd5c8a6d4c1485d
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_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 debStatusIndex(std::string
const &File
);
47 virtual ~debStatusIndex();
50 class debPackagesIndex
: public pkgDebianIndexTargetFile
54 virtual uint8_t GetIndexFlags() const;
57 virtual const Type
*GetType() const APT_CONST
;
59 // Stuff for accessing files on remote items
60 virtual std::string
ArchiveInfo(pkgCache::VerIterator
const &Ver
) const APT_OVERRIDE
;
62 // Interface for the Cache Generator
63 virtual bool HasPackages() const APT_OVERRIDE
{return true;};
65 debPackagesIndex(IndexTarget
const &Target
, bool const Trusted
);
66 virtual ~debPackagesIndex();
69 class debTranslationsIndex
: public pkgDebianIndexTargetFile
73 virtual std::string
GetArchitecture() const APT_OVERRIDE
;
74 virtual uint8_t GetIndexFlags() const APT_OVERRIDE
;
75 virtual bool OpenListFile(FileFd
&Pkg
, std::string
const &FileName
) APT_OVERRIDE
;
76 APT_HIDDEN
virtual pkgCacheListParser
* CreateListParser(FileFd
&Pkg
) APT_OVERRIDE
;
80 virtual const Type
*GetType() const APT_CONST
;
82 // Interface for the Cache Generator
83 virtual bool HasPackages() const APT_OVERRIDE
;
85 debTranslationsIndex(IndexTarget
const &Target
);
86 virtual ~debTranslationsIndex();
89 class debSourcesIndex
: public pkgDebianIndexTargetFile
92 virtual uint8_t GetIndexFlags() const;
93 virtual bool OpenListFile(FileFd
&Pkg
, std::string
const &FileName
) APT_OVERRIDE
;
94 APT_HIDDEN
virtual pkgCacheListParser
* CreateListParser(FileFd
&Pkg
) APT_OVERRIDE
;
98 virtual const Type
*GetType() const APT_CONST
;
100 // Stuff for accessing files on remote items
101 virtual std::string
SourceInfo(pkgSrcRecords::Parser
const &Record
,
102 pkgSrcRecords::File
const &File
) const APT_OVERRIDE
;
104 // Interface for the record parsers
105 virtual pkgSrcRecords::Parser
*CreateSrcParser() const APT_OVERRIDE
;
107 // Interface for the Cache Generator
108 virtual bool HasPackages() const APT_OVERRIDE
{return false;};
110 debSourcesIndex(IndexTarget
const &Target
, bool const Trusted
);
111 virtual ~debSourcesIndex();
114 class debDebPkgFileIndex
: public pkgDebianIndexRealFile
120 virtual std::string
GetComponent() const APT_OVERRIDE
;
121 virtual std::string
GetArchitecture() const APT_OVERRIDE
;
122 virtual uint8_t GetIndexFlags() const APT_OVERRIDE
;
123 virtual bool OpenListFile(FileFd
&Pkg
, std::string
const &FileName
) APT_OVERRIDE
;
124 APT_HIDDEN
virtual pkgCacheListParser
* CreateListParser(FileFd
&Pkg
) APT_OVERRIDE
;
127 virtual const Type
*GetType() const APT_CONST
;
129 /** get the control (file) content of the deb file
131 * @param[out] content of the control file
132 * @param debfile is the filename of the .deb-file
133 * @return \b true if successful, otherwise \b false.
135 static bool GetContent(std::ostream
&content
, std::string
const &debfile
);
137 // Interface for the Cache Generator
138 virtual bool HasPackages() const APT_OVERRIDE
{return true;}
139 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const APT_OVERRIDE
;
141 // Interface for acquire
143 debDebPkgFileIndex(std::string
const &DebFile
);
144 virtual ~debDebPkgFileIndex();
147 class debDscFileIndex
: public pkgDebianIndexRealFile
151 virtual const Type
*GetType() const APT_CONST
;
152 virtual pkgSrcRecords::Parser
*CreateSrcParser() const APT_OVERRIDE
;
153 virtual bool HasPackages() const APT_OVERRIDE
{return false;};
155 debDscFileIndex(std::string
const &DscFile
);
156 virtual ~debDscFileIndex();
159 class debDebianSourceDirIndex
: public debDscFileIndex
162 virtual const Type
*GetType() const APT_CONST
;