1 // -*- mode: cpp; mode: fold -*-
3 // $Id: sourcelist.h,v 1.9 2001/02/20 07:03:17 jgg Exp $
4 /* ######################################################################
6 SourceList - Manage a list of sources
8 The Source List class provides access to a list of sources. It
9 can read them from a file and generate a list of all the distinct
12 All sources have a type associated with them that defines the layout
13 of the archive. The exact format of the file is documented in
16 The types are mapped through a list of type definitions which handle
17 the actual construction of the type. After loading a source list all
18 you have is a list of package index files that have the ability
21 ##################################################################### */
23 #ifndef PKGLIB_SOURCELIST_H
24 #define PKGLIB_SOURCELIST_H
28 #include <apt-pkg/pkgcache.h>
29 #include <apt-pkg/indexfile.h>
32 #pragma interface "apt-pkg/sourcelist.h"
40 // List of supported source list types
45 // Global list of Items supported
46 static Type
**GlobalList
;
47 static unsigned long GlobalListLen
;
48 static Type
*GetType(const char *Type
);
53 bool FixupURI(string
&URI
) const;
54 virtual bool ParseLine(vector
<pkgIndexFile
*> &List
,
56 unsigned long CurLine
,string File
) const;
57 virtual bool CreateItem(vector
<pkgIndexFile
*> &List
,string URI
,
58 string Dist
,string Section
) const = 0;
64 typedef vector
<pkgIndexFile
*>::const_iterator const_iterator
;
68 vector
<pkgIndexFile
*> List
;
73 bool Read(string File
);
76 inline const_iterator
begin() const {return List
.begin();};
77 inline const_iterator
end() const {return List
.end();};
78 inline unsigned int size() const {return List
.size();};
79 inline bool empty() const {return List
.empty();};
81 bool FindIndex(pkgCache::PkgFileIterator File
,
82 pkgIndexFile
*&Found
) const;
83 bool GetIndexes(pkgAcquire
*Owner
) const;
86 pkgSourceList(string File
);