debindexfile.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. #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. // Interface for the Cache Generator
  49. virtual bool Exists() const;
  50. virtual bool HasPackages() const {return true;};
  51. virtual unsigned long Size() const;
  52. virtual bool Merge(pkgCacheGenerator &Gen,OpProgress &Prog) const;
  53. virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
  54. debPackagesIndex(string URI,string Dist,string Section,bool Trusted);
  55. };
  56. class debSourcesIndex : public pkgIndexFile
  57. {
  58. string URI;
  59. string Dist;
  60. string Section;
  61. string Info(const char *Type) const;
  62. string IndexFile(const char *Type) const;
  63. string IndexURI(const char *Type) const;
  64. public:
  65. virtual const Type *GetType() const;
  66. // Stuff for accessing files on remote items
  67. virtual string SourceInfo(pkgSrcRecords::Parser const &Record,
  68. pkgSrcRecords::File const &File) const;
  69. virtual string ArchiveURI(string File) const {return URI + File;};
  70. // Interface for acquire
  71. virtual string Describe(bool Short) const;
  72. // Interface for the record parsers
  73. virtual pkgSrcRecords::Parser *CreateSrcParser() const;
  74. // Interface for the Cache Generator
  75. virtual bool Exists() const;
  76. virtual bool HasPackages() const {return false;};
  77. virtual unsigned long Size() const;
  78. debSourcesIndex(string URI,string Dist,string Section,bool Trusted);
  79. };
  80. #endif