vendor.cc 1.0 KB

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