]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/debmetaindex.h
replace ULONG_MAX with c++ style std::numeric_limits
[apt.git] / apt-pkg / deb / debmetaindex.h
CommitLineData
b3d44315
MV
1// ijones, walters
2#ifndef PKGLIB_DEBMETAINDEX_H
3#define PKGLIB_DEBMETAINDEX_H
4
b3d44315 5#include <apt-pkg/metaindex.h>
453b82a3 6#include <apt-pkg/macros.h>
b3d44315 7
5dd4c8b8 8#include <map>
472ff00e
DK
9#include <string>
10#include <vector>
5dd4c8b8 11
b9dadc24
DK
12#ifndef APT_8_CLEANER_HEADERS
13#include <apt-pkg/sourcelist.h>
14#endif
453b82a3
DK
15#ifndef APT_10_CLEANER_HEADERS
16#include <apt-pkg/init.h>
17#endif
18
19class pkgAcquire;
20class pkgIndexFile;
0d29b9d4 21class debDebPkgFileIndex;
80624be7 22class IndexTarget;
b9dadc24 23
dce45dbe 24class APT_HIDDEN debReleaseIndex : public metaIndex {
b3d44315
MV
25 public:
26
27 class debSectionEntry
28 {
29 public:
472ff00e
DK
30 debSectionEntry (std::string const &Section, bool const &IsSrc);
31 std::string const Section;
5dd4c8b8 32 bool const IsSrc;
b3d44315
MV
33 };
34
35 private:
ff72bd0d
MV
36 /** \brief dpointer placeholder (for later in case we need it) */
37 void *d;
472ff00e 38 std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
3809194b 39 enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
b3d44315
MV
40
41 public:
42
472ff00e
DK
43 debReleaseIndex(std::string const &URI, std::string const &Dist);
44 debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted);
ff72bd0d 45 virtual ~debReleaseIndex();
b3d44315 46
472ff00e 47 virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
5dd4c8b8 48 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
80624be7 49 std::vector <IndexTarget *>* ComputeIndexTargets() const;
7014e148 50
472ff00e
DK
51 std::string MetaIndexInfo(const char *Type) const;
52 std::string MetaIndexFile(const char *Types) const;
53 std::string MetaIndexURI(const char *Type) const;
7014e148 54
ccf6bdb3 55#if APT_PKG_ABI >= 413
f105aaba 56 virtual
7014e148 57#endif
f105aaba 58 std::string LocalFileName() const;
7014e148 59
472ff00e 60 virtual std::vector <pkgIndexFile *> *GetIndexFiles();
b3d44315 61
4b42f43b 62 void SetTrusted(bool const Trusted);
b3d44315
MV
63 virtual bool IsTrusted() const;
64
472ff00e
DK
65 void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry);
66 void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry);
b3d44315
MV
67};
68
dce45dbe 69class APT_HIDDEN debDebFileMetaIndex : public metaIndex
0d29b9d4
MV
70{
71 private:
72 std::string DebFile;
73 debDebPkgFileIndex *DebIndex;
74 public:
75 virtual std::string ArchiveURI(std::string const& /*File*/) const {
76 return DebFile;
77 }
78 virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) const {
79 return true;
80 }
81 virtual std::vector<pkgIndexFile *> *GetIndexFiles() {
82 return Indexes;
83 }
84 virtual bool IsTrusted() const {
85 return true;
86 }
87 debDebFileMetaIndex(std::string const &DebFile);
88 virtual ~debDebFileMetaIndex() {};
89
90};
91
b3d44315 92#endif