]>
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
21 #include <apt-pkg/indexfile.h>
23 class debStatusIndex
: public pkgIndexFile
25 /** \brief dpointer placeholder (for later in case we need it) */
33 virtual const Type
*GetType() const;
35 // Interface for acquire
36 virtual std::string
Describe(bool Short
) const {return File
;};
38 // Interface for the Cache Generator
39 virtual bool Exists() const;
40 virtual bool HasPackages() const {return true;};
41 virtual unsigned long Size() const;
42 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
43 bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
, unsigned long const Flag
) const;
44 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
46 debStatusIndex(std::string File
);
47 virtual ~debStatusIndex() {};
50 class debPackagesIndex
: public pkgIndexFile
52 /** \brief dpointer placeholder (for later in case we need it) */
58 std::string Architecture
;
60 std::string
Info(const char *Type
) const;
61 std::string
IndexFile(const char *Type
) const;
62 std::string
IndexURI(const char *Type
) const;
66 virtual const Type
*GetType() const;
68 // Stuff for accessing files on remote items
69 virtual std::string
ArchiveInfo(pkgCache::VerIterator Ver
) const;
70 virtual std::string
ArchiveURI(std::string File
) const {return URI
+ File
;};
72 // Interface for acquire
73 virtual std::string
Describe(bool Short
) const;
75 // Interface for the Cache Generator
76 virtual bool Exists() const;
77 virtual bool HasPackages() const {return true;};
78 virtual unsigned long Size() const;
79 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
80 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
82 debPackagesIndex(std::string
const &URI
, std::string
const &Dist
, std::string
const &Section
,
83 bool const &Trusted
, std::string
const &Arch
= "native");
84 virtual ~debPackagesIndex() {};
87 class debTranslationsIndex
: public pkgIndexFile
89 /** \brief dpointer placeholder (for later in case we need it) */
95 const char * const Language
;
97 std::string
Info(const char *Type
) const;
98 std::string
IndexFile(const char *Type
) const;
99 std::string
IndexURI(const char *Type
) const;
101 inline std::string
TranslationFile() const {return std::string("Translation-").append(Language
);};
105 virtual const Type
*GetType() const;
107 // Interface for acquire
108 virtual std::string
Describe(bool Short
) const;
109 virtual bool GetIndexes(pkgAcquire
*Owner
) const;
111 // Interface for the Cache Generator
112 virtual bool Exists() const;
113 virtual bool HasPackages() const;
114 virtual unsigned long Size() const;
115 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
*Prog
) const;
116 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
118 debTranslationsIndex(std::string URI
,std::string Dist
,std::string Section
, char const * const Language
);
119 virtual ~debTranslationsIndex() {};
122 class debSourcesIndex
: public pkgIndexFile
124 /** \brief dpointer placeholder (for later in case we need it) */
131 std::string
Info(const char *Type
) const;
132 std::string
IndexFile(const char *Type
) const;
133 std::string
IndexURI(const char *Type
) const;
137 virtual const Type
*GetType() const;
139 // Stuff for accessing files on remote items
140 virtual std::string
SourceInfo(pkgSrcRecords::Parser
const &Record
,
141 pkgSrcRecords::File
const &File
) const;
142 virtual std::string
ArchiveURI(std::string File
) const {return URI
+ File
;};
144 // Interface for acquire
145 virtual std::string
Describe(bool Short
) const;
147 // Interface for the record parsers
148 virtual pkgSrcRecords::Parser
*CreateSrcParser() const;
150 // Interface for the Cache Generator
151 virtual bool Exists() const;
152 virtual bool HasPackages() const {return false;};
153 virtual unsigned long Size() const;
155 debSourcesIndex(std::string URI
,std::string Dist
,std::string Section
,bool Trusted
);
156 virtual ~debSourcesIndex() {};