vendor.cc 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifdef __GNUG__
  2. #pragma implementation "apt-pkg/vendor.h"
  3. #endif
  4. #include <iostream>
  5. #include <apt-pkg/error.h>
  6. #include <apt-pkg/vendor.h>
  7. #include <apt-pkg/configuration.h>
  8. Vendor::Vendor(std::string VendorID,
  9. std::string Origin,
  10. std::vector<struct Vendor::Fingerprint *> *FingerprintList)
  11. {
  12. this->VendorID = VendorID;
  13. this->Origin = Origin;
  14. for (std::vector<struct Vendor::Fingerprint *>::iterator I = FingerprintList->begin();
  15. I != FingerprintList->end(); I++)
  16. {
  17. if (_config->FindB("Debug::Vendor", false))
  18. std::cerr << "Vendor \"" << VendorID << "\": Mapping \""
  19. << (*I)->Print << "\" to \"" << (*I)->Description << '"' << std::endl;
  20. Fingerprints[(*I)->Print] = (*I)->Description;
  21. }
  22. delete FingerprintList;
  23. }
  24. const string Vendor::LookupFingerprint(string Print) const
  25. {
  26. std::map<string,string>::const_iterator Elt = Fingerprints.find(Print);
  27. if (Elt == Fingerprints.end())
  28. return "";
  29. else
  30. return (*Elt).second;
  31. }
  32. bool Vendor::CheckDist(string Dist)
  33. {
  34. return true;
  35. }