File: vendor.cc

package info (click to toggle)
apt 1.0.9.8.4
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 15,080 kB
  • ctags: 5,307
  • sloc: cpp: 50,972; sh: 12,111; xml: 4,130; makefile: 855; perl: 209; python: 28
file content (41 lines) | stat: -rw-r--r-- 1,104 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<config.h>

#include <apt-pkg/vendor.h>
#include <apt-pkg/configuration.h>

#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>

Vendor::Vendor(std::string VendorID,
               std::string Origin,
	       std::vector<struct Vendor::Fingerprint *> *FingerprintList)
{
   this->VendorID = VendorID;
   this->Origin = Origin;
   for (std::vector<struct Vendor::Fingerprint *>::iterator I = FingerprintList->begin();
	I != FingerprintList->end(); ++I)
   {
      if (_config->FindB("Debug::Vendor", false))
         std::cerr << "Vendor \"" << VendorID << "\": Mapping \""
		   << (*I)->Print << "\" to \"" << (*I)->Description << '"' << std::endl;
      Fingerprints[(*I)->Print] = (*I)->Description;
   }
   delete FingerprintList;
}

const std::string Vendor::LookupFingerprint(std::string Print) const
{
   std::map<std::string,std::string>::const_iterator Elt = Fingerprints.find(Print);
   if (Elt == Fingerprints.end())
      return "";
   else
      return (*Elt).second;
}

APT_CONST bool Vendor::CheckDist(std::string /*Dist*/)
{
   return true;
}