00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef PKGLIB_INDEXFILE_H
00023 #define PKGLIB_INDEXFILE_H
00024
00025
00026 #include <string>
00027 #include <apt-pkg/pkgcache.h>
00028 #include <apt-pkg/srcrecords.h>
00029 #include <apt-pkg/pkgrecords.h>
00030
00031 using std::string;
00032
00033 class pkgAcquire;
00034 class pkgCacheGenerator;
00035 class OpProgress;
00036 class pkgIndexFile
00037 {
00038 protected:
00039 bool Trusted;
00040
00041 public:
00042
00043 class Type
00044 {
00045 public:
00046
00047
00048 static Type **GlobalList;
00049 static unsigned long GlobalListLen;
00050 static Type *GetType(const char *Type);
00051
00052 const char *Label;
00053
00054 virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator ) const {return 0;};
00055 Type();
00056 virtual ~Type() {};
00057 };
00058
00059 virtual const Type *GetType() const = 0;
00060
00061
00062 virtual string ArchiveInfo(pkgCache::VerIterator Ver) const;
00063 virtual string SourceInfo(pkgSrcRecords::Parser const &Record,
00064 pkgSrcRecords::File const &File) const;
00065 virtual string Describe(bool Short = false) const = 0;
00066
00067
00068 virtual string ArchiveURI(string ) const {return string();};
00069
00070
00071 virtual pkgSrcRecords::Parser *CreateSrcParser() const {return 0;};
00072
00073
00074 virtual bool Exists() const = 0;
00075 virtual bool HasPackages() const = 0;
00076 virtual unsigned long Size() const = 0;
00077 virtual bool Merge(pkgCacheGenerator &,OpProgress* ) const { return false; };
00078 __deprecated virtual bool Merge(pkgCacheGenerator &Gen, OpProgress &Prog) const
00079 { return Merge(Gen, &Prog); };
00080 virtual bool MergeFileProvides(pkgCacheGenerator &,OpProgress* ) const {return true;};
00081 __deprecated virtual bool MergeFileProvides(pkgCacheGenerator &Gen, OpProgress &Prog) const
00082 {return MergeFileProvides(Gen, &Prog);};
00083 virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const;
00084
00085 static bool TranslationsAvailable();
00086 static bool CheckLanguageCode(const char *Lang);
00087 static string LanguageCode();
00088
00089 bool IsTrusted() const { return Trusted; };
00090
00091 pkgIndexFile(bool Trusted): Trusted(Trusted) {};
00092 virtual ~pkgIndexFile() {};
00093 };
00094
00095 #endif