xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
ip_host_entry.h
Go to the documentation of this file.
1 #pragma once
5 
6 #include <vector>
7 #include "../core_export.h"
8 #include "../object.h"
9 #include "../types.h"
10 #include "../ustring.h"
11 #include "ip_address.h"
12 
14 namespace xtd {
16  namespace net {
24  public:
26  ip_host_entry() = default;
27 
30  ip_host_entry(const ip_host_entry& ip_host_entry) = default;
31  ip_host_entry& operator=(const ip_host_entry&) = default;
32  friend std::ostream& operator <<(std::ostream& os, const ip_host_entry& host_entry) noexcept {return os << host_entry.to_string();}
34 
37  const std::vector<xtd::net::ip_address>& address_list() const noexcept;
40  std::vector<xtd::net::ip_address>& address_list() noexcept;
44  ip_host_entry& address_list(const std::vector<xtd::net::ip_address>& address_list) noexcept;
45 
48  const std::vector<xtd::ustring>& aliases() const noexcept;
51  std::vector<xtd::ustring>& aliases() noexcept;
55  ip_host_entry& aliases(const std::vector<xtd::ustring>& aliases) noexcept;
56 
59  const xtd::ustring& host_name() const noexcept;
63  ip_host_entry& host_name(const xtd::ustring& host_name) noexcept;
64 
65  private:
66  std::vector<xtd::net::ip_address> address_list_;
67  std::vector<xtd::ustring> aliases_;
68  xtd::ustring host_name_;
69  };
70  }
71 }
Provides an Internet Protocol (IP) address.
Definition: ip_address.h:30
Provides a container class for Internet host address information.
Definition: ip_host_entry.h:23
ip_host_entry()=default
Initializes a new instance of the xtd::net::ip_host_entry.
const std::vector< xtd::net::ip_address > & address_list() const noexcept
Get List of IP addresses that are associated with a host.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition: object.h:26
virtual xtd::ustring to_string() const noexcept
Returns a std::string that represents the current object.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
#define core_export_
Define shared library export.
Definition: core_export.h:13
Contains xtd::net::ip_address class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17