vendorlist.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #ifdef __GNUG__
  19. #pragma interface "apt-pkg/vendorlist.h"
  20. #endif
  21. class pkgVendorList
  22. {
  23. protected:
  24. vector<Vendor const *> VendorList;
  25. bool CreateList(Configuration& Cnf);
  26. const Vendor* LookupFingerprint(string Fingerprint);
  27. public:
  28. typedef vector<Vendor const *>::const_iterator const_iterator;
  29. bool ReadMainList();
  30. bool Read(string File);
  31. // List accessors
  32. inline const_iterator begin() const {return VendorList.begin();};
  33. inline const_iterator end() const {return VendorList.end();};
  34. inline unsigned int size() const {return VendorList.size();};
  35. inline bool empty() const {return VendorList.empty();};
  36. const Vendor* FindVendor(const vector<string> GPGVOutput);
  37. ~pkgVendorList();
  38. };
  39. #endif