debindexfile.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 debTranslationsIndex : public pkgIndexFile
  54. {
  55. string URI;
  56. string Dist;
  57. string Section;
  58. const char * const Language;
  59. string Info(const char *Type) const;
  60. string IndexFile(const char *Type) const;
  61. string IndexURI(const char *Type) const;
  62. inline string TranslationFile() const {return string("Translation-").append(Language);};
  63. public:
  64. virtual const Type *GetType() const;
  65. // Interface for acquire
  66. virtual string Describe(bool Short) const;
  67. virtual bool GetIndexes(pkgAcquire *Owner) const;
  68. // Interface for the Cache Generator
  69. virtual bool Exists() const;
  70. virtual bool HasPackages() const;
  71. virtual unsigned long Size() const;
  72. virtual bool Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const;
  73. virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
  74. debTranslationsIndex(string URI,string Dist,string Section, char const * const Language);
  75. };
  76. class debSourcesIndex : public pkgIndexFile
  77. {
  78. string URI;
  79. string Dist;
  80. string Section;
  81. string Info(const char *Type) const;
  82. string IndexFile(const char *Type) const;
  83. string IndexURI(const char *Type) const;
  84. public:
  85. virtual const Type *GetType() const;
  86. // Stuff for accessing files on remote items
  87. virtual string SourceInfo(pkgSrcRecords::Parser const &Record,
  88. pkgSrcRecords::File const &File) const;
  89. virtual string ArchiveURI(string File) const {return URI + File;};
  90. // Interface for acquire
  91. virtual string Describe(bool Short) const;
  92. // Interface for the record parsers
  93. virtual pkgSrcRecords::Parser *CreateSrcParser() const;
  94. // Interface for the Cache Generator
  95. virtual bool Exists() const;
  96. virtual bool HasPackages() const {return false;};
  97. virtual unsigned long Size() const;
  98. debSourcesIndex(string URI,string Dist,string Section,bool Trusted);
  99. };
  100. #endif