debindexfile.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: debindexfile.h,v 1.3 2001/04/29 05:13:51 jgg 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. #ifdef __GNUG__
  15. #pragma interface "apt-pkg/debindexfile.h"
  16. #endif
  17. #include <apt-pkg/indexfile.h>
  18. class debStatusIndex : public pkgIndexFile
  19. {
  20. string File;
  21. public:
  22. virtual const Type *GetType() const;
  23. // Interface for acquire
  24. virtual string Describe(bool Short) const {return File;};
  25. // Interface for the Cache Generator
  26. virtual bool Exists() const;
  27. virtual bool HasPackages() const {return true;};
  28. virtual unsigned long Size() const;
  29. virtual bool Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const;
  30. virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
  31. debStatusIndex(string File);
  32. };
  33. class debPackagesIndex : public pkgIndexFile
  34. {
  35. string URI;
  36. string Dist;
  37. string Section;
  38. string Info(const char *Type) const;
  39. string IndexFile(const char *Type) const;
  40. string IndexURI(const char *Type) const;
  41. public:
  42. virtual const Type *GetType() const;
  43. // Stuff for accessing files on remote items
  44. virtual string ArchiveInfo(pkgCache::VerIterator Ver) const;
  45. virtual string ArchiveURI(string File) const {return URI + File;};
  46. // Interface for acquire
  47. virtual string Describe(bool Short) const;
  48. virtual bool GetIndexes(pkgAcquire *Owner) const;
  49. // Interface for the Cache Generator
  50. virtual bool Exists() const;
  51. virtual bool HasPackages() const {return true;};
  52. virtual unsigned long Size() const;
  53. virtual bool Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const;
  54. virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
  55. debPackagesIndex(string URI,string Dist,string Section);
  56. };
  57. class debSourcesIndex : public pkgIndexFile
  58. {
  59. string URI;
  60. string Dist;
  61. string Section;
  62. string Info(const char *Type) const;
  63. string IndexFile(const char *Type) const;
  64. string IndexURI(const char *Type) const;
  65. public:
  66. virtual const Type *GetType() const;
  67. // Stuff for accessing files on remote items
  68. virtual string SourceInfo(pkgSrcRecords::Parser const &Record,
  69. pkgSrcRecords::File const &File) const;
  70. virtual string ArchiveURI(string File) const {return URI + File;};
  71. // Interface for acquire
  72. virtual string Describe(bool Short) const;
  73. virtual bool GetIndexes(pkgAcquire *Owner) const;
  74. // Interface for the record parsers
  75. virtual pkgSrcRecords::Parser *CreateSrcParser() const;
  76. // Interface for the Cache Generator
  77. virtual bool Exists() const;
  78. virtual bool HasPackages() const {return false;};
  79. virtual unsigned long Size() const;
  80. debSourcesIndex(string URI,string Dist,string Section);
  81. };
  82. #endif