From 6c139d6e362f04a1582e8a8f511f8aeab031fecf Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:50:41 +0000 Subject: Sync Author: jgg Date: 1998-07-07 04:17:00 GMT Sync --- apt-pkg/sourcelist.h | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 apt-pkg/sourcelist.h (limited to 'apt-pkg/sourcelist.h') 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 +#include +#include +#include + +#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::const_iterator const_iterator; + + protected: + + vector 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 -- cgit v1.2.3