apt  0.9.14
debmetaindex.h
1 // ijones, walters
2 #ifndef PKGLIB_DEBMETAINDEX_H
3 #define PKGLIB_DEBMETAINDEX_H
4 
5 #include <apt-pkg/metaindex.h>
6 #include <apt-pkg/init.h>
7 
8 #include <map>
9 #include <string>
10 #include <vector>
11 
12 #ifndef APT_8_CLEANER_HEADERS
13 #include <apt-pkg/sourcelist.h>
14 #endif
15 
16 class debReleaseIndex : public metaIndex {
17  public:
18 
20  {
21  public:
22  debSectionEntry (std::string const &Section, bool const &IsSrc);
23  std::string const Section;
24  bool const IsSrc;
25  };
26 
27  private:
29  void *d;
30  std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
31  enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
32 
33  public:
34 
35  debReleaseIndex(std::string const &URI, std::string const &Dist);
36  debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted);
37  virtual ~debReleaseIndex();
38 
39  virtual std::string ArchiveURI(std::string const &File) const {return URI + File;};
40  virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const;
41  std::vector <struct IndexTarget *>* ComputeIndexTargets() const;
42  std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const;
43 
44  std::string MetaIndexInfo(const char *Type) const;
45  std::string MetaIndexFile(const char *Types) const;
46  std::string MetaIndexURI(const char *Type) const;
47 
48 #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
49  virtual std::string LocalFileName() const;
50 #endif
51 
52  std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const;
53  std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const;
54  std::string SourceIndexURI(const char *Type, const std::string &Section) const;
55  std::string SourceIndexURISuffix(const char *Type, const std::string &Section) const;
56  std::string TranslationIndexURI(const char *Type, const std::string &Section) const;
57  std::string TranslationIndexURISuffix(const char *Type, const std::string &Section) const;
58  virtual std::vector <pkgIndexFile *> *GetIndexFiles();
59 
60  void SetTrusted(bool const Trusted);
61  virtual bool IsTrusted() const;
62 
63  void PushSectionEntry(std::vector<std::string> const &Archs, const debSectionEntry *Entry);
64  void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry);
65  void PushSectionEntry(const debSectionEntry *Entry);
66 };
67 
68 #endif
Definition: strutl.h:148
Definition: debmetaindex.h:19
The core download scheduler. {{{.
Definition: acquire.h:93
Definition: metaindex.h:21
Definition: debmetaindex.h:16