]>
git.saurik.com Git - apt.git/blob - apt-pkg/indexfile.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: indexfile.h,v 1.6 2002/07/08 03:13:30 jgg Exp $
4 /* ######################################################################
6 Index File - Abstraction for an index of archive/source file.
8 There are 3 primary sorts of index files, all represented by this
12 Bianry index files decribing the local system
15 They are all bundled together here, and the interfaces for
16 sources.list, acquire, cache gen and record parsing all use this class
17 to acess the underlying representation.
19 ##################################################################### */
21 #ifndef PKGLIB_INDEXFILE_H
22 #define PKGLIB_INDEXFILE_H
25 #pragma interface "apt-pkg/indexfile.h"
29 #include <apt-pkg/pkgcache.h>
30 #include <apt-pkg/srcrecords.h>
31 #include <apt-pkg/pkgrecords.h>
36 class pkgCacheGenerator
;
46 // Global list of Items supported
47 static Type
**GlobalList
;
48 static unsigned long GlobalListLen
;
49 static Type
*GetType(const char *Type
);
53 virtual pkgRecords::Parser
*CreatePkgParser(pkgCache::PkgFileIterator
/*File*/) const {return 0;};
57 virtual const Type
*GetType() const = 0;
59 // Return descriptive strings of various sorts
60 virtual string
ArchiveInfo(pkgCache::VerIterator Ver
) const;
61 virtual string
SourceInfo(pkgSrcRecords::Parser
const &Record
,
62 pkgSrcRecords::File
const &File
) const;
63 virtual string
Describe(bool Short
= false) const = 0;
65 // Interface for acquire
66 virtual string
ArchiveURI(string
/*File*/) const {return string();};
67 virtual bool GetIndexes(pkgAcquire
*Owner
) const;
69 // Interface for the record parsers
70 virtual pkgSrcRecords::Parser
*CreateSrcParser() const {return 0;};
72 // Interface for the Cache Generator
73 virtual bool Exists() const = 0;
74 virtual bool HasPackages() const = 0;
75 virtual unsigned long Size() const = 0;
76 virtual bool Merge(pkgCacheGenerator
&/*Gen*/,OpProgress
&/*Prog*/) const {return false;};
77 virtual bool MergeFileProvides(pkgCacheGenerator
&/*Gen*/,OpProgress
&/*Prog*/) const {return true;};
78 virtual pkgCache::PkgFileIterator
FindInCache(pkgCache
&Cache
) const;
80 virtual ~pkgIndexFile() {};