]> git.saurik.com Git - apt.git/blame - apt-pkg/deb/debmetaindex.h
set char-limits for the scanf parsing previous crash-reports
[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>
b3d44315 6
5dd4c8b8 7#include <map>
472ff00e
DK
8#include <string>
9#include <vector>
5dd4c8b8 10
b9dadc24
DK
11#ifndef APT_8_CLEANER_HEADERS
12#include <apt-pkg/sourcelist.h>
13#endif
14
b3d44315
MV
15class debReleaseIndex : public metaIndex {
16 public:
17
18 class debSectionEntry
19 {
20 public:
472ff00e
DK
21 debSectionEntry (std::string const &Section, bool const &IsSrc);
22 std::string const Section;
5dd4c8b8 23 bool const IsSrc;
b3d44315
MV
24 };
25
26 private:
ff72bd0d
MV
27 /** \brief dpointer placeholder (for later in case we need it) */
28 void *d;
472ff00e 29 std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
4b42f43b 30 enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
b3d44315
MV
31
32 public:
33
472ff00e
DK
34 debReleaseIndex(std::string const &URI, std::string const &Dist);
35 debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted);
ff72bd0d 36 virtual ~debReleaseIndex();
b3d44315 37
472ff00e 38 virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
5dd4c8b8 39 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
472ff00e
DK
40 std::vector <struct IndexTarget *>* ComputeIndexTargets() const;
41 std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const;
42 std::string MetaIndexInfo(const char *Type) const;
43 std::string MetaIndexFile(const char *Types) const;
44 std::string MetaIndexURI(const char *Type) const;
45 std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const;
46 std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const;
47 std::string SourceIndexURI(const char *Type, const std::string &Section) const;
48 std::string SourceIndexURISuffix(const char *Type, const std::string &Section) const;
49 std::string TranslationIndexURI(const char *Type, const std::string &Section) const;
50 std::string TranslationIndexURISuffix(const char *Type, const std::string &Section) const;
51 virtual std::vector <pkgIndexFile *> *GetIndexFiles();
b3d44315 52
4b42f43b 53 void SetTrusted(bool const Trusted);
b3d44315
MV
54 virtual bool IsTrusted() const;
55
472ff00e
DK
56 void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry);
57 void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry);
b3d44315
MV
58 void PushSectionEntry(const debSectionEntry *Entry);
59};
60
61#endif