You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

142 lines
3.9 KiB

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