| 1 | // -*- mode: cpp; mode: fold -*- |
| 2 | // Description /*{{{*/ |
| 3 | // $Id: vendorlist.h,v 1.1.2.1 2003/12/24 23:09:17 mdz Exp $ |
| 4 | /* ###################################################################### |
| 5 | |
| 6 | VendorList - Manage a list of vendors |
| 7 | |
| 8 | The Vendor List class provides access to a list of vendors and |
| 9 | attributes associated with them, read from a configuration file. |
| 10 | |
| 11 | ##################################################################### */ |
| 12 | /*}}}*/ |
| 13 | #ifndef PKGLIB_VENDORLIST_H |
| 14 | #define PKGLIB_VENDORLIST_H |
| 15 | |
| 16 | #include <string> |
| 17 | #include <vector> |
| 18 | #include <apt-pkg/macros.h> |
| 19 | |
| 20 | #ifndef APT_8_CLEANER_HEADERS |
| 21 | #include <apt-pkg/vendor.h> |
| 22 | #include <apt-pkg/configuration.h> |
| 23 | using std::string; |
| 24 | using std::vector; |
| 25 | #endif |
| 26 | |
| 27 | class Vendor; |
| 28 | class Configuration; |
| 29 | |
| 30 | class APT_DEPRECATED pkgVendorList |
| 31 | { |
| 32 | protected: |
| 33 | std::vector<Vendor const *> VendorList; |
| 34 | |
| 35 | bool CreateList(Configuration& Cnf); |
| 36 | const Vendor* LookupFingerprint(std::string Fingerprint); |
| 37 | |
| 38 | public: |
| 39 | typedef std::vector<Vendor const *>::const_iterator const_iterator; |
| 40 | bool ReadMainList(); |
| 41 | bool Read(std::string File); |
| 42 | |
| 43 | // List accessors |
| 44 | inline const_iterator begin() const {return VendorList.begin();}; |
| 45 | inline const_iterator end() const {return VendorList.end();}; |
| 46 | inline unsigned int size() const {return VendorList.size();}; |
| 47 | inline bool empty() const {return VendorList.empty();}; |
| 48 | |
| 49 | const Vendor* FindVendor(const std::vector<std::string> GPGVOutput); |
| 50 | |
| 51 | ~pkgVendorList(); |
| 52 | }; |
| 53 | |
| 54 | #endif |