vendor.cc 1.1 KB

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