1 | #ifndef CPR_RESOLVE_H |
---|---|
2 | #define CPR_RESOLVE_H |
3 | |
4 | #include <string> |
5 | #include <set> |
6 | |
7 | namespace cpr { |
8 | class Resolve { |
9 | public: |
10 | std::string host; |
11 | std::string addr; |
12 | std::set<uint16_t> ports; |
13 | |
14 | Resolve(const std::string& host_param, const std::string& addr_param, const std::set<uint16_t>& ports_param = std::set<uint16_t>{80U, 443U}): host(host_param), addr(addr_param), ports(ports_param) { |
15 | if (this->ports.empty()) { |
16 | this->ports.insert(x: 80U); |
17 | this->ports.insert(x: 443U); |
18 | } |
19 | } |
20 | }; |
21 | } // namespace cpr |
22 | |
23 | #endif |
24 |