debindexfile.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: debindexfile.h,v 1.3.2.1 2003/12/24 23:09:17 mdz Exp $
  4. /* ######################################################################
  5. Debian Index Files
  6. There are three sorts currently
  7. Package files that have File: tags
  8. Package files that don't (/var/lib/dpkg/status)
  9. Source files
  10. ##################################################################### */
  11. /*}}}*/
  12. #ifndef PKGLIB_DEBINDEXFILE_H
  13. #define PKGLIB_DEBINDEXFILE_H
  14. #include <apt-pkg/indexfile.h>
  15. class debStatusIndex : public pkgIndexFile
  16. {
  17. string File;
  18. public:
  19. virtual const Type *GetType() const;
  20. // Interface for acquire
  21. virtual string Describe(bool Short) const {return File;};
  22. // Interface for the Cache Generator
  23. virtual bool Exists() const;
  24. virtual bool HasPackages() const {return true;};
  25. virtual unsigned long Size() const;
  26. virtual bool Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const;
  27. virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
  28. debStatusIndex(string File);
  29. };
  30. class debPackagesIndex : public pkgIndexFile
  31. {
  32. string URI;
  33. string Dist;
  34. string Section;
  35. string Info(const char *Type) const;
  36. string IndexFile(const char *Type) const;
  37. string IndexURI(const char *Type) const;
  38. public:
  39. virtual const Type *GetType() const;
  40. // Stuff for accessing files on remote items
  41. virtual string ArchiveInfo(pkgCache::VerIterator Ver) const;
  42. virtual string ArchiveURI(string File) const {return URI + File;};
  43. // Interface for acquire
  44. virtual string Describe(bool Short) const;
  45. // Interface for the Cache Generator
  46. virtual bool Exists() const;
  47. virtual bool HasPackages() const {return true;};
  48. virtual unsigned long Size() const;
  49. virtual bool Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const;
  50. virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
  51. debPackagesIndex(string URI,string Dist,string Section,bool Trusted);
  52. };
  53. class debSourcesIndex : public pkgIndexFile
  54. {
  55. string URI;
  56. string Dist;
  57. string Section;
  58. string Info(const char *Type) const;
  59. string IndexFile(const char *Type) const;
  60. string IndexURI(const char *Type) const;
  61. public:
  62. virtual const Type *GetType() const;
  63. // Stuff for accessing files on remote items
  64. virtual string SourceInfo(pkgSrcRecords::Parser const &Record,
  65. pkgSrcRecords::File const &File) const;
  66. virtual string ArchiveURI(string File) const {return URI + File;};
  67. // Interface for acquire
  68. virtual string Describe(bool Short) const;
  69. // Interface for the record parsers
  70. virtual pkgSrcRecords::Parser *CreateSrcParser() const;
  71. // Interface for the Cache Generator
  72. virtual bool Exists() const;
  73. virtual bool HasPackages() const {return false;};
  74. virtual unsigned long Size() const;
  75. debSourcesIndex(string URI,string Dist,string Section,bool Trusted);
  76. };
  77. #endif