]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/debindexfile.h
* Applied patch from Aurelien Jarno <aurel32@debian.org> to avoid CPU
[apt.git] / apt-pkg / deb / debindexfile.h
CommitLineData
b2e465d6
AL
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
7db98ffc 3// $Id: debindexfile.h,v 1.3.2.1 2003/12/24 23:09:17 mdz Exp $
b2e465d6
AL
4/* ######################################################################
5
6 Debian Index Files
7
8 There are three sorts currently
9
10 Package files that have File: tags
11 Package files that don't (/var/lib/dpkg/status)
12 Source files
13
14 ##################################################################### */
15 /*}}}*/
16#ifndef PKGLIB_DEBINDEXFILE_H
17#define PKGLIB_DEBINDEXFILE_H
18
13500573 19
b2e465d6
AL
20
21#include <apt-pkg/indexfile.h>
22
23class debStatusIndex : public pkgIndexFile
24{
25 string File;
26
27 public:
28
29 virtual const Type *GetType() const;
30
31 // Interface for acquire
af87ab54 32 virtual string Describe(bool Short) const {return File;};
b2e465d6
AL
33
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;
40
41 debStatusIndex(string File);
42};
43
44class debPackagesIndex : public pkgIndexFile
45{
46 string URI;
47 string Dist;
48 string Section;
7db98ffc 49
b2e465d6
AL
50 string Info(const char *Type) const;
51 string IndexFile(const char *Type) const;
7db98ffc 52 string IndexURI(const char *Type) const;
b2e465d6
AL
53
54 public:
55
56 virtual const Type *GetType() const;
57
58 // Stuff for accessing files on remote items
59 virtual string ArchiveInfo(pkgCache::VerIterator Ver) const;
60 virtual string ArchiveURI(string File) const {return URI + File;};
61
62 // Interface for acquire
af87ab54 63 virtual string Describe(bool Short) const;
b2e465d6
AL
64
65 // Interface for the Cache Generator
66 virtual bool Exists() const;
67 virtual bool HasPackages() const {return true;};
68 virtual unsigned long Size() const;
69 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const;
70 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
7db98ffc
MZ
71
72 debPackagesIndex(string URI,string Dist,string Section,bool Trusted);
b2e465d6
AL
73};
74
a52f938b
OS
75class debTranslationsIndex : public pkgIndexFile
76{
77 string URI;
78 string Dist;
79 string Section;
80
81 string Info(const char *Type) const;
82 string IndexFile(const char *Type) const;
83 string IndexURI(const char *Type) const;
84
85 inline string TranslationFile() const {return "Translation-" + LanguageCode();};
86
87 public:
88
89 virtual const Type *GetType() const;
90
91 // Interface for acquire
92 virtual string Describe(bool Short) const;
93 virtual bool GetIndexes(pkgAcquire *Owner) const;
94
95 // Interface for the Cache Generator
96 virtual bool Exists() const;
11680bfd 97 virtual bool HasPackages() const;
a52f938b
OS
98 virtual unsigned long Size() const;
99 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const;
c51c6f08 100 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
a52f938b
OS
101
102 debTranslationsIndex(string URI,string Dist,string Section);
103};
104
b2e465d6
AL
105class debSourcesIndex : public pkgIndexFile
106{
107 string URI;
108 string Dist;
109 string Section;
110
111 string Info(const char *Type) const;
112 string IndexFile(const char *Type) const;
7db98ffc 113 string IndexURI(const char *Type) const;
b2e465d6
AL
114
115 public:
116
117 virtual const Type *GetType() const;
118
119 // Stuff for accessing files on remote items
120 virtual string SourceInfo(pkgSrcRecords::Parser const &Record,
121 pkgSrcRecords::File const &File) const;
122 virtual string ArchiveURI(string File) const {return URI + File;};
123
124 // Interface for acquire
af87ab54 125 virtual string Describe(bool Short) const;
b2e465d6
AL
126
127 // Interface for the record parsers
128 virtual pkgSrcRecords::Parser *CreateSrcParser() const;
129
130 // Interface for the Cache Generator
131 virtual bool Exists() const;
132 virtual bool HasPackages() const {return false;};
133 virtual unsigned long Size() const;
134
7db98ffc 135 debSourcesIndex(string URI,string Dist,string Section,bool Trusted);
b2e465d6
AL
136};
137
138#endif