vendorlist.h

00001 // -*- mode: cpp; mode: fold -*-
00002 // Description                                                          /*{{{*/
00003 // $Id: vendorlist.h,v 1.1.2.1 2003/12/24 23:09:17 mdz Exp $
00004 /* ######################################################################
00005 
00006    VendorList - Manage a list of vendors
00007    
00008    The Vendor List class provides access to a list of vendors and
00009    attributes associated with them, read from a configuration file.
00010    
00011    ##################################################################### */
00012                                                                         /*}}}*/
00013 #ifndef PKGLIB_VENDORLIST_H
00014 #define PKGLIB_VENDORLIST_H
00015 
00016 #include <string>
00017 #include <vector>
00018 #include <apt-pkg/vendor.h>
00019 #include <apt-pkg/configuration.h>
00020 
00021 using std::string;
00022 using std::vector;
00023 
00024 
00025 class pkgVendorList
00026 {
00027    protected:
00028    vector<Vendor const *> VendorList;
00029 
00030    bool CreateList(Configuration& Cnf);
00031    const Vendor* LookupFingerprint(string Fingerprint);
00032 
00033    public:
00034    typedef vector<Vendor const *>::const_iterator const_iterator;
00035    bool ReadMainList();
00036    bool Read(string File);
00037 
00038    // List accessors
00039    inline const_iterator begin() const {return VendorList.begin();};
00040    inline const_iterator end() const {return VendorList.end();};
00041    inline unsigned int size() const {return VendorList.size();};
00042    inline bool empty() const {return VendorList.empty();};
00043 
00044    const Vendor* FindVendor(const vector<string> GPGVOutput);
00045 
00046    ~pkgVendorList();
00047 };
00048 
00049 #endif