vendorlist.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. VendorList - Manage a list of vendors
  6. The Vendor List class provides access to a list of vendors and
  7. attributes associated with them, read from a configuration file.
  8. ##################################################################### */
  9. /*}}}*/
  10. #ifndef PKGLIB_VENDORLIST_H
  11. #define PKGLIB_VENDORLIST_H
  12. #include <string>
  13. #include <vector>
  14. #include <apt-pkg/vendor.h>
  15. #include <apt-pkg/configuration.h>
  16. using std::string;
  17. using std::vector;
  18. class pkgVendorList
  19. {
  20. protected:
  21. vector<Vendor const *> VendorList;
  22. bool CreateList(Configuration& Cnf);
  23. const Vendor* LookupFingerprint(string Fingerprint);
  24. public:
  25. typedef vector<Vendor const *>::const_iterator const_iterator;
  26. bool ReadMainList();
  27. bool Read(string File);
  28. // List accessors
  29. inline const_iterator begin() const {return VendorList.begin();};
  30. inline const_iterator end() const {return VendorList.end();};
  31. inline unsigned int size() const {return VendorList.size();};
  32. inline bool empty() const {return VendorList.empty();};
  33. const Vendor* FindVendor(const vector<string> GPGVOutput);
  34. ~pkgVendorList();
  35. };
  36. #endif