vendorlist.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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/macros.h>
  15. #ifndef APT_8_CLEANER_HEADERS
  16. #include <apt-pkg/vendor.h>
  17. #include <apt-pkg/configuration.h>
  18. using std::string;
  19. using std::vector;
  20. #endif
  21. class Vendor;
  22. class Configuration;
  23. class __deprecated pkgVendorList
  24. {
  25. protected:
  26. std::vector<Vendor const *> VendorList;
  27. bool CreateList(Configuration& Cnf);
  28. const Vendor* LookupFingerprint(std::string Fingerprint);
  29. public:
  30. typedef std::vector<Vendor const *>::const_iterator const_iterator;
  31. bool ReadMainList();
  32. bool Read(std::string File);
  33. // List accessors
  34. inline const_iterator begin() const {return VendorList.begin();};
  35. inline const_iterator end() const {return VendorList.end();};
  36. inline unsigned int size() const {return VendorList.size();};
  37. inline bool empty() const {return VendorList.empty();};
  38. const Vendor* FindVendor(const std::vector<std::string> GPGVOutput);
  39. ~pkgVendorList();
  40. };
  41. #endif