merge with debian-sid (some version screw going on here)
[ntk/apt.git] / apt-pkg / deb / debmetaindex.h
1 // ijones, walters
2 #ifndef PKGLIB_DEBMETAINDEX_H
3 #define PKGLIB_DEBMETAINDEX_H
4
5 #include <apt-pkg/metaindex.h>
6
7 #include <map>
8 #include <string>
9 #include <vector>
10
11 #ifndef APT_8_CLEANER_HEADERS
12 #include <apt-pkg/sourcelist.h>
13 #endif
14
15 class debReleaseIndex : public metaIndex {
16 public:
17
18 class debSectionEntry
19 {
20 public:
21 debSectionEntry (std::string const &Section, bool const &IsSrc);
22 std::string const Section;
23 bool const IsSrc;
24 };
25
26 private:
27 /** \brief dpointer placeholder (for later in case we need it) */
28 void *d;
29 std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
30 enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
31
32 public:
33
34 debReleaseIndex(std::string const &URI, std::string const &Dist);
35 debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted);
36 virtual ~debReleaseIndex();
37
38 virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
39 virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
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();
52
53 void SetTrusted(bool const Trusted);
54 virtual bool IsTrusted() const;
55
56 void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry);
57 void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry);
58 void PushSectionEntry(const debSectionEntry *Entry);
59 };
60
61 #endif