]>
git.saurik.com Git - apt.git/blob - apt-pkg/indexfile.cc
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: indexfile.cc,v 1.2 2001/02/20 07:03:17 jgg Exp $
4 /* ######################################################################
6 Index File - Abstraction for an index of archive/souce file.
8 ##################################################################### */
10 // Include Files /*{{{*/
12 #pragma implementation "apt-pkg/indexfile.h"
15 #include <apt-pkg/indexfile.h>
16 #include <apt-pkg/error.h>
19 // Global list of Item supported
20 static pkgIndexFile::Type
*ItmList
[10];
21 pkgIndexFile::Type
**pkgIndexFile::Type::GlobalList
= ItmList
;
22 unsigned long pkgIndexFile::Type::GlobalListLen
= 0;
24 // Type::Type - Constructor /*{{{*/
25 // ---------------------------------------------------------------------
27 pkgIndexFile::Type::Type()
29 ItmList
[GlobalListLen
] = this;
33 // Type::GetType - Locate the type by name /*{{{*/
34 // ---------------------------------------------------------------------
36 pkgIndexFile::Type
*pkgIndexFile::Type::GetType(const char *Type
)
38 for (unsigned I
= 0; I
!= GlobalListLen
; I
++)
39 if (strcmp(GlobalList
[I
]->Label
,Type
) == 0)
45 // IndexFile::GetIndexes - Stub /*{{{*/
46 // ---------------------------------------------------------------------
48 bool pkgIndexFile::GetIndexes(pkgAcquire
*Owner
) const
50 return _error
->Error("Internal Error, this index file is not downloadable");
53 // IndexFile::ArchiveInfo - Stub /*{{{*/
54 // ---------------------------------------------------------------------
56 string
pkgIndexFile::ArchiveInfo(pkgCache::VerIterator Ver
) const
61 // IndexFile::FindInCache - Stub /*{{{*/
62 // ---------------------------------------------------------------------
64 pkgCache::PkgFileIterator
pkgIndexFile::FindInCache(pkgCache
&Cache
) const
66 return pkgCache::PkgFileIterator(Cache
);
69 // IndexFile::SourceIndex - Stub /*{{{*/
70 // ---------------------------------------------------------------------
72 string
pkgIndexFile::SourceInfo(pkgSrcRecords::Parser
const &Record
,
73 pkgSrcRecords::File
const &File
) const