diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:50:41 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:50:41 +0000 |
commit | 6c139d6e362f04a1582e8a8f511f8aeab031fecf (patch) | |
tree | c200b8f51da9bcfe612b7ceb645e6eec9ebac9f1 /apt-pkg/sourcelist.h | |
parent | 2246928b428c3ece2c2743da5b0bb63257e37a85 (diff) |
Sync
Author: jgg
Date: 1998-07-07 04:17:00 GMT
Sync
Diffstat (limited to 'apt-pkg/sourcelist.h')
-rw-r--r-- | apt-pkg/sourcelist.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h new file mode 100644 index 000000000..986d5e9e8 --- /dev/null +++ b/apt-pkg/sourcelist.h @@ -0,0 +1,78 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +// $Id: sourcelist.h,v 1.1 1998/07/07 04:17:06 jgg Exp $ +/* ###################################################################### + + SourceList - Manage a list of sources + + The Source List class provides access to a list of sources. It + can read them from a file and generate a list of all the permutations. + + ##################################################################### */ + /*}}}*/ +// Header section: pkglib +#ifndef PKGLIB_SOURCELIST_H +#define PKGLIB_SOURCELIST_H + +#include <string> +#include <vector> +#include <iostream.h> +#include <pkglib/pkgcache.h> + +#ifdef __GNUG__ +#pragma interface "pkglib/sourcelist.h" +#endif + +class pkgAquire; +class pkgSourceList +{ + public: + + /* Each item in the source list, each line can have more than one + item */ + struct Item + { + enum {Deb} Type; + + string URI; + string Dist; + string Section; + + bool SetType(string S); + bool SetURI(string S); + string PackagesURI() const; + string PackagesInfo() const; + string SiteOnly(string URI) const; + string ArchiveInfo(pkgCache::VerIterator Ver) const; + string ArchiveURI(string File) const; + }; + typedef vector<Item>::const_iterator const_iterator; + + protected: + + vector<Item> List; + + public: + + bool ReadMainList(); + bool Read(string File); + string SanitizeURI(string URI); + const_iterator MatchPkgFile(pkgCache::VerIterator Ver); + + // List accessors + inline const_iterator begin() const {return List.begin();}; + inline const_iterator end() const {return List.end();}; + inline unsigned int size() const {return List.size();}; + inline bool empty() const {return List.empty();}; + + pkgSourceList(); + pkgSourceList(string File); +}; + +bool pkgUpdateMeta(pkgSourceList &List,pkgAquire &Engine); +bool pkgMakeSrcCache(pkgSourceList &List); +bool pkgMakeStatusCache(); + +ostream &operator <<(ostream &O,pkgSourceList::Item &Itm); + +#endif |