]>
git.saurik.com Git - apt.git/blob - apt-pkg/indexfile.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: indexfile.h,v 1.6.2.1 2003/12/24 23:09:17 mdz Exp $
4 /* ######################################################################
6 Index File - Abstraction for an index of archive/source file.
8 There are 4 primary sorts of index files, all represented by this
12 Binary translation files
13 Binary index files describing the local system
16 They are all bundled together here, and the interfaces for
17 sources.list, acquire, cache gen and record parsing all use this class
18 to access the underlying representation.
20 ##################################################################### */
22 #ifndef PKGLIB_INDEXFILE_H
23 #define PKGLIB_INDEXFILE_H
25 #include <apt-pkg/srcrecords.h>
26 #include <apt-pkg/pkgrecords.h>
27 #include <apt-pkg/pkgcache.h>
28 #include <apt-pkg/cacheiterators.h>
29 #include <apt-pkg/macros.h>
33 #ifndef APT_8_CLEANER_HEADERS
36 #ifndef APT_10_CLEANER_HEADERS
40 class pkgCacheGenerator
;
54 // Global list of Items supported
55 static Type
**GlobalList
;
56 static unsigned long GlobalListLen
;
57 static Type
*GetType(const char *Type
) APT_PURE
;
61 virtual pkgRecords::Parser
*CreatePkgParser(pkgCache::PkgFileIterator
/*File*/) const {return 0;};
66 virtual const Type
*GetType() const = 0;
68 // Return descriptive strings of various sorts
69 virtual std::string
ArchiveInfo(pkgCache::VerIterator Ver
) const;
70 virtual std::string
SourceInfo(pkgSrcRecords::Parser
const &Record
,
71 pkgSrcRecords::File
const &File
) const;
72 virtual std::string
Describe(bool Short
= false) const = 0;
74 // Interface for acquire
75 virtual std::string
ArchiveURI(std::string
/*File*/) const {return std::string();};
77 // Interface for the record parsers
78 virtual pkgSrcRecords::Parser
*CreateSrcParser() const {return 0;};
80 // Interface for the Cache Generator
81 virtual bool Exists() const = 0;
82 virtual bool HasPackages() const = 0;
83 virtual unsigned long Size() const = 0;
84 virtual bool Merge(pkgCacheGenerator
&/*Gen*/, OpProgress
* /*Prog*/) const { return false; };
85 APT_DEPRECATED
virtual bool Merge(pkgCacheGenerator
&Gen
, OpProgress
&Prog
) const
86 { return Merge(Gen
, &Prog
); };
87 virtual bool MergeFileProvides(pkgCacheGenerator
&/*Gen*/,OpProgress
* /*Prog*/) const {return true;};
88 APT_DEPRECATED
virtual bool MergeFileProvides(pkgCacheGenerator
&Gen
, OpProgress
&Prog
) const
89 {return MergeFileProvides(Gen
, &Prog
);};
90 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
92 static bool TranslationsAvailable();
93 static bool CheckLanguageCode(const char *Lang
);
94 static std::string
LanguageCode();
96 bool IsTrusted() const { return Trusted
; };
98 pkgIndexFile(bool Trusted
): Trusted(Trusted
) {};
99 virtual ~pkgIndexFile() {};