]>
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
29 virtual const Type
*GetType() const;
31 // Interface for acquire
32 virtual string
Describe(bool Short
) const {return File
;};
34 // Interface for the Cache Generator
35 virtual bool Exists() const;
36 virtual bool HasPackages() const {return true;};
37 virtual unsigned long Size() const;
38 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
&Prog
) const;
39 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
41 debStatusIndex(string File
);
44 class debPackagesIndex
: public pkgIndexFile
51 string
Info(const char *Type
) const;
52 string
IndexFile(const char *Type
) const;
53 string
IndexURI(const char *Type
) const;
57 virtual const Type
*GetType() const;
59 // Stuff for accessing files on remote items
60 virtual string
ArchiveInfo(pkgCache::VerIterator Ver
) const;
61 virtual string
ArchiveURI(string File
) const {return URI
+ File
;};
63 // Interface for acquire
64 virtual string
Describe(bool Short
) const;
66 // Interface for the Cache Generator
67 virtual bool Exists() const;
68 virtual bool HasPackages() const {return true;};
69 virtual unsigned long Size() const;
70 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
&Prog
) const;
71 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
73 debPackagesIndex(string
const &URI
, string
const &Dist
, string
const &Section
,
74 bool const &Trusted
, string
const &Arch
= "native");
77 class debTranslationsIndex
: public pkgIndexFile
82 const char * const Language
;
84 string
Info(const char *Type
) const;
85 string
IndexFile(const char *Type
) const;
86 string
IndexURI(const char *Type
) const;
88 inline string
TranslationFile() const {return string("Translation-").append(Language
);};
92 virtual const Type
*GetType() const;
94 // Interface for acquire
95 virtual string
Describe(bool Short
) const;
96 virtual bool GetIndexes(pkgAcquire
*Owner
) const;
98 // Interface for the Cache Generator
99 virtual bool Exists() const;
100 virtual bool HasPackages() const;
101 virtual unsigned long Size() const;
102 virtual bool Merge(pkgCacheGenerator
&Gen
,OpProgress
&Prog
) const;
103 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
105 debTranslationsIndex(string URI
,string Dist
,string Section
, char const * const Language
);
108 class debSourcesIndex
: public pkgIndexFile
114 string
Info(const char *Type
) const;
115 string
IndexFile(const char *Type
) const;
116 string
IndexURI(const char *Type
) const;
120 virtual const Type
*GetType() const;
122 // Stuff for accessing files on remote items
123 virtual string
SourceInfo(pkgSrcRecords::Parser
const &Record
,
124 pkgSrcRecords::File
const &File
) const;
125 virtual string
ArchiveURI(string File
) const {return URI
+ File
;};
127 // Interface for acquire
128 virtual string
Describe(bool Short
) const;
130 // Interface for the record parsers
131 virtual pkgSrcRecords::Parser
*CreateSrcParser() const;
133 // Interface for the Cache Generator
134 virtual bool Exists() const;
135 virtual bool HasPackages() const {return false;};
136 virtual unsigned long Size() const;
138 debSourcesIndex(string URI
,string Dist
,string Section
,bool Trusted
);