vendor.cc 1001 B

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