]>
git.saurik.com Git - apt.git/blob - apt-pkg/deb/debindexfile.h
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 debStatusIndex
: public pkgIndexFile
33 /** \brief dpointer placeholder (for later in case we need it) */
41 virtual const Type
*GetType() const APT_CONST
;
43 // Interface for acquire
44 virtual std::string
Describe(bool /*Short*/) const {return File
;};
46 // Interface for the Cache Generator
47 virtual bool Exists() const;
48 virtual bool HasPackages() const {return true;};
49 virtual unsigned long Size() const;
50 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
51 bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
, unsigned long const Flag
) const;
52 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
54 debStatusIndex(std::string File
);
55 virtual ~debStatusIndex() {};
58 class debPackagesIndex
: public pkgIndexFile
60 /** \brief dpointer placeholder (for later in case we need it) */
66 std::string Architecture
;
68 std::string
Info(const char *Type
) const;
69 std::string
IndexFile(const char *Type
) const;
70 std::string
IndexURI(const char *Type
) const;
74 virtual const Type
*GetType() const APT_CONST
;
76 // Stuff for accessing files on remote items
77 virtual std::string
ArchiveInfo(pkgCache::VerIterator Ver
) const;
78 virtual std::string
ArchiveURI(std::string File
) const {return URI
+ File
;};
80 // Interface for acquire
81 virtual std::string
Describe(bool Short
) const;
83 // Interface for the Cache Generator
84 virtual bool Exists() const;
85 virtual bool HasPackages() const {return true;};
86 virtual unsigned long Size() const;
87 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
88 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
90 debPackagesIndex(std::string
const &URI
, std::string
const &Dist
, std::string
const &Section
,
91 bool const &Trusted
, std::string
const &Arch
= "native");
92 virtual ~debPackagesIndex() {};
95 class debTranslationsIndex
: public pkgIndexFile
97 /** \brief dpointer placeholder (for later in case we need it) */
103 const char * const Language
;
105 std::string
Info(const char *Type
) const;
106 std::string
IndexFile(const char *Type
) const;
107 std::string
IndexURI(const char *Type
) const;
109 inline std::string
TranslationFile() const {return std::string("Translation-").append(Language
);};
113 virtual const Type
*GetType() const APT_CONST
;
115 // Interface for acquire
116 virtual std::string
Describe(bool Short
) const;
117 virtual bool GetIndexes(pkgAcquire
*Owner
) const;
119 // Interface for the Cache Generator
120 virtual bool Exists() const;
121 virtual bool HasPackages() const;
122 virtual unsigned long Size() const;
123 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
124 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
126 debTranslationsIndex(std::string URI
,std::string Dist
,std::string Section
, char const * const Language
);
127 virtual ~debTranslationsIndex() {};
130 class debSourcesIndex
: public pkgIndexFile
132 /** \brief dpointer placeholder (for later in case we need it) */
139 std::string
Info(const char *Type
) const;
140 std::string
IndexFile(const char *Type
) const;
141 std::string
IndexURI(const char *Type
) const;
145 virtual const Type
*GetType() const APT_CONST
;
147 // Stuff for accessing files on remote items
148 virtual std::string
SourceInfo(pkgSrcRecords::Parser
const &Record
,
149 pkgSrcRecords::File
const &File
) const;
150 virtual std::string
ArchiveURI(std::string File
) const {return URI
+ File
;};
152 // Interface for acquire
153 virtual std::string
Describe(bool Short
) const;
155 // Interface for the record parsers
156 virtual pkgSrcRecords::Parser
*CreateSrcParser() const;
158 // Interface for the Cache Generator
159 virtual bool Exists() const;
160 virtual bool HasPackages() const {return false;};
161 virtual unsigned long Size() const;
163 debSourcesIndex(std::string URI
,std::string Dist
,std::string Section
,bool Trusted
);
164 virtual ~debSourcesIndex() {};