]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/debindexfile.h
allow ratelimiting progress reporting for testcases
[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
453b82a3
DK
19#include <apt-pkg/indexfile.h>
20#include <apt-pkg/cacheiterators.h>
21#include <apt-pkg/pkgcache.h>
22#include <apt-pkg/srcrecords.h>
13500573 23
453b82a3
DK
24#include <string>
25
26class OpProgress;
27class pkgAcquire;
28class pkgCacheGenerator;
b2e465d6 29
b2e465d6 30
dce45dbe 31class APT_HIDDEN debStatusIndex : public pkgIndexFile
b2e465d6 32{
6d38011b 33 protected:
8f3ba4e8 34 std::string File;
6d38011b 35
b2e465d6
AL
36 public:
37
a02db58f 38 virtual const Type *GetType() const APT_CONST;
e3c1cfc7 39
b2e465d6 40 // Interface for acquire
65512241 41 virtual std::string Describe(bool /*Short*/) const {return File;};
e3c1cfc7 42
b2e465d6
AL
43 // Interface for the Cache Generator
44 virtual bool Exists() const;
45 virtual bool HasPackages() const {return true;};
46 virtual unsigned long Size() const;
2e5f4e45 47 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
b2e465d6
AL
48 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
49
8f3ba4e8 50 debStatusIndex(std::string File);
862bafea 51 virtual ~debStatusIndex();
b2e465d6 52};
3809194b 53
e3c1cfc7
DK
54class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile
55{
b2e465d6 56 public:
e3c1cfc7 57
a02db58f 58 virtual const Type *GetType() const APT_CONST;
b2e465d6
AL
59
60 // Stuff for accessing files on remote items
8f3ba4e8 61 virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const;
e3c1cfc7 62
b2e465d6 63 // Interface for the Cache Generator
b2e465d6 64 virtual bool HasPackages() const {return true;};
2e5f4e45 65 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
b2e465d6 66 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
7db98ffc 67
e3c1cfc7 68 debPackagesIndex(IndexTarget const &Target, bool const Trusted);
862bafea 69 virtual ~debPackagesIndex();
b2e465d6
AL
70};
71
e3c1cfc7 72class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile
a52f938b 73{
a52f938b 74 public:
d38926ef 75
a02db58f 76 virtual const Type *GetType() const APT_CONST;
a52f938b 77
a52f938b 78 // Interface for the Cache Generator
11680bfd 79 virtual bool HasPackages() const;
2e5f4e45 80 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
c51c6f08 81 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
a52f938b 82
e3c1cfc7 83 debTranslationsIndex(IndexTarget const &Target);
862bafea 84 virtual ~debTranslationsIndex();
a52f938b
OS
85};
86
e3c1cfc7 87class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile
b2e465d6 88{
b2e465d6
AL
89 public:
90
a02db58f 91 virtual const Type *GetType() const APT_CONST;
b2e465d6
AL
92
93 // Stuff for accessing files on remote items
8f3ba4e8 94 virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record,
b2e465d6 95 pkgSrcRecords::File const &File) const;
b2e465d6
AL
96
97 // Interface for the record parsers
98 virtual pkgSrcRecords::Parser *CreateSrcParser() const;
e3c1cfc7 99
b2e465d6 100 // Interface for the Cache Generator
b2e465d6 101 virtual bool HasPackages() const {return false;};
e3c1cfc7
DK
102
103 debSourcesIndex(IndexTarget const &Target, bool const Trusted);
862bafea 104 virtual ~debSourcesIndex();
b2e465d6
AL
105};
106
dce45dbe 107class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile
0d29b9d4
MV
108{
109 private:
110 void *d;
111 std::string DebFile;
112 std::string DebFileFullPath;
113
114 public:
115 virtual const Type *GetType() const APT_CONST;
116
117 virtual std::string Describe(bool /*Short*/) const {
118 return DebFile;
119 }
120
2f6a2fbb
DK
121 /** get the control (file) content of the deb file
122 *
123 * @param[out] content of the control file
124 * @param debfile is the filename of the .deb-file
125 * @return \b true if successful, otherwise \b false.
126 */
127 static bool GetContent(std::ostream &content, std::string const &debfile);
128
0d29b9d4
MV
129 // Interface for the Cache Generator
130 virtual bool Exists() const;
131 virtual bool HasPackages() const {
132 return true;
133 };
134 virtual unsigned long Size() const;
135 virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const;
136 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
137
138 // Interface for acquire
139 virtual std::string ArchiveURI(std::string /*File*/) const;
140
141 debDebPkgFileIndex(std::string DebFile);
862bafea
DK
142 virtual ~debDebPkgFileIndex();
143};
070536e6 144
dce45dbe 145class APT_HIDDEN debDscFileIndex : public pkgIndexFile
a49e7948
MV
146{
147 private:
148 std::string DscFile;
149 public:
150 virtual const Type *GetType() const APT_CONST;
151 virtual pkgSrcRecords::Parser *CreateSrcParser() const;
152 virtual bool Exists() const;
153 virtual bool HasPackages() const {return false;};
154 virtual unsigned long Size() const;
155 virtual std::string Describe(bool /*Short*/) const {
156 return DscFile;
157 };
158
159 debDscFileIndex(std::string &DscFile);
160 virtual ~debDscFileIndex() {};
161};
162
dce45dbe 163class APT_HIDDEN debDebianSourceDirIndex : public debDscFileIndex
77da39b9 164{
3809194b 165 public:
77da39b9 166 virtual const Type *GetType() const APT_CONST;
0d29b9d4
MV
167};
168
b2e465d6 169#endif