The NetAddress
class represents a network address.
More...
#include <net_address.h>
The NetAddress
class represents a network address.
Definition at line 18 of file net_address.h.
pp::NetAddress::NetAddress |
( |
| ) |
|
A constructor used when you have received a PP_Resource
as a return value that has had 1 ref added for you.
- Parameters
-
[in] | resource | A PPB_NetAddress resource. |
pp::NetAddress::NetAddress |
( |
const InstanceHandle & |
instance, |
|
|
const PP_NetAddress_IPv4 & |
ipv4_addr |
|
) |
| |
A constructor used to create a NetAddress
object with the specified IPv4 address.
- Parameters
-
[in] | instance | The instance with which this resource will be associated. |
[in] | ipv4_addr | An IPv4 address. |
pp::NetAddress::NetAddress |
( |
const InstanceHandle & |
instance, |
|
|
const PP_NetAddress_IPv6 & |
ipv6_addr |
|
) |
| |
A constructor used to create a NetAddress
object with the specified IPv6 address.
- Parameters
-
[in] | instance | The instance with which this resource will be associated. |
[in] | ipv6_addr | An IPv6 address. |
pp::NetAddress::NetAddress |
( |
const NetAddress & |
other | ) |
|
virtual pp::NetAddress::~NetAddress |
( |
| ) |
|
|
virtual |
bool pp::NetAddress::DescribeAsIPv4Address |
( |
PP_NetAddress_IPv4 * |
ipv4_addr | ) |
const |
Fills a PP_NetAddress_IPv4
structure if the network address is of PP_NETADDRESS_FAMILY_IPV4
address family. Note that passing a network address of PP_NETADDRESS_FAMILY_IPV6
address family will fail even if the address is an IPv4-mapped IPv6 address.
- Parameters
-
[out] | ipv4_addr | A PP_NetAddress_IPv4 structure to store the result. |
- Returns
- A boolean value indicating whether the operation succeeded.
bool pp::NetAddress::DescribeAsIPv6Address |
( |
PP_NetAddress_IPv6 * |
ipv6_addr | ) |
const |
Fills a PP_NetAddress_IPv6
structure if the network address is of PP_NETADDRESS_FAMILY_IPV6
address family. Note that passing a network address of PP_NETADDRESS_FAMILY_IPV4
address family will fail - this method doesn't map it to an IPv6 address.
- Parameters
-
[out] | ipv6_addr | A PP_NetAddress_IPv6 structure to store the result. |
- Returns
- A boolean value indicating whether the operation succeeded.
Var pp::NetAddress::DescribeAsString |
( |
bool |
include_port | ) |
const |
Returns a human-readable description of the network address. The description is in the form of host [ ":" port ] and conforms to http://tools.ietf.org/html/rfc3986#section-3.2 for IPv4 and IPv6 addresses (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80").
- Parameters
-
[in] | include_port | Whether to include the port number in the description. |
- Returns
- A string
Var
on success; an undefined Var
on failure.
PP_NetAddress_Family pp::NetAddress::GetFamily |
( |
| ) |
const |
Gets the address family.
- Returns
- The address family on success;
PP_NETADDRESS_FAMILY_UNSPECIFIED
on failure.
static bool pp::NetAddress::IsAvailable |
( |
| ) |
|
|
static |
Static function for determining whether the browser supports the PPB_NetAddress
interface.
- Returns
- true if the interface is available, false otherwise.
The documentation for this class was generated from the following file: