1#include "cpr/proxies.h"
2
3#include <initializer_list>
4#include <map>
5#include <string>
6#include <utility>
7
8namespace cpr {
9
10Proxies::Proxies(const std::initializer_list<std::pair<const std::string, std::string>>& hosts) : hosts_{hosts} {}
11Proxies::Proxies(const std::map<std::string, std::string>& hosts) : hosts_{hosts} {}
12
13bool Proxies::has(const std::string& protocol) const {
14 return hosts_.count(x: protocol) > 0;
15}
16
17const std::string& Proxies::operator[](const std::string& protocol) {
18 return hosts_[protocol];
19}
20
21} // namespace cpr
22