debmetaindex.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef PKGLIB_DEBMETAINDEX_H
  2. #define PKGLIB_DEBMETAINDEX_H
  3. #include <apt-pkg/metaindex.h>
  4. #include <apt-pkg/macros.h>
  5. #include <map>
  6. #include <string>
  7. #include <vector>
  8. #ifndef APT_8_CLEANER_HEADERS
  9. #include <apt-pkg/sourcelist.h>
  10. #endif
  11. #ifndef APT_10_CLEANER_HEADERS
  12. #include <apt-pkg/init.h>
  13. #endif
  14. class pkgAcquire;
  15. class pkgIndexFile;
  16. class IndexTarget;
  17. class pkgCacheGenerator;
  18. class OpProgress;
  19. class debReleaseIndexPrivate;
  20. class APT_HIDDEN debReleaseIndex : public metaIndex
  21. {
  22. debReleaseIndexPrivate * const d;
  23. APT_HIDDEN bool parseSumData(const char *&Start, const char *End, std::string &Name,
  24. std::string &Hash, unsigned long long &Size);
  25. public:
  26. APT_HIDDEN std::string MetaIndexInfo(const char *Type) const;
  27. APT_HIDDEN std::string MetaIndexFile(const char *Types) const;
  28. APT_HIDDEN std::string MetaIndexURI(const char *Type) const;
  29. debReleaseIndex(std::string const &URI, std::string const &Dist, std::map<std::string,std::string> const &Options = std::map<std::string,std::string>());
  30. debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted, std::map<std::string,std::string> const &Options = std::map<std::string,std::string>());
  31. virtual ~debReleaseIndex();
  32. virtual std::string ArchiveURI(std::string const &File) const APT_OVERRIDE {return URI + File;};
  33. virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) APT_OVERRIDE;
  34. virtual std::vector<IndexTarget> GetIndexTargets() const APT_OVERRIDE;
  35. virtual std::string Describe() const APT_OVERRIDE;
  36. virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const APT_OVERRIDE;
  37. virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE;
  38. virtual bool Load(std::string const &Filename, std::string * const ErrorText) APT_OVERRIDE;
  39. virtual metaIndex * UnloadedClone() const APT_OVERRIDE;
  40. virtual std::vector <pkgIndexFile *> *GetIndexFiles() APT_OVERRIDE;
  41. bool SetTrusted(TriState const Trusted);
  42. bool SetCheckValidUntil(TriState const Trusted);
  43. bool SetValidUntilMin(time_t const Valid);
  44. bool SetValidUntilMax(time_t const Valid);
  45. bool SetSignedBy(std::string const &SignedBy);
  46. std::map<std::string, std::string> GetReleaseOptions();
  47. virtual bool IsTrusted() const APT_OVERRIDE;
  48. bool IsArchitectureSupported(std::string const &arch) const;
  49. bool IsArchitectureAllSupportedFor(IndexTarget const &target) const;
  50. void AddComponent(std::string const &sourcesEntry,
  51. bool const isSrc, std::string const &Name,
  52. std::vector<std::string> const &Targets,
  53. std::vector<std::string> const &Architectures,
  54. std::vector<std::string> Languages,
  55. bool const usePDiffs, std::string const &useByHash);
  56. };
  57. #endif