Pepper_47_C++_interfaces
|
The NetAddress
class represents a network address.
More...
#include <net_address.h>
Public Member Functions | |
NetAddress () | |
NetAddress (PassRef, PP_Resource resource) | |
NetAddress (const InstanceHandle &instance, const PP_NetAddress_IPv4 &ipv4_addr) | |
NetAddress (const InstanceHandle &instance, const PP_NetAddress_IPv6 &ipv6_addr) | |
NetAddress (const NetAddress &other) | |
virtual | ~NetAddress () |
The destructor. More... | |
NetAddress & | operator= (const NetAddress &other) |
PP_NetAddress_Family | GetFamily () const |
Var | DescribeAsString (bool include_port) const |
bool | DescribeAsIPv4Address (PP_NetAddress_IPv4 *ipv4_addr) const |
bool | DescribeAsIPv6Address (PP_NetAddress_IPv6 *ipv6_addr) const |
![]() | |
Resource () | |
The default constructor. More... | |
Resource (const Resource &other) | |
virtual | ~Resource () |
Destructor. More... | |
Resource & | operator= (const Resource &other) |
bool | is_null () const |
PP_Resource | pp_resource () const |
PP_Resource | detach () |
Static Public Member Functions | |
static bool | IsAvailable () |
Additional Inherited Members | |
![]() | |
Resource (PP_Resource resource) | |
Resource (PassRef, PP_Resource resource) | |
void | PassRefFromConstructor (PP_Resource resource) |
void | Clear () |
Sets this resource to null. This releases ownership of the resource. More... | |
The NetAddress
class represents a network address.
Definition at line 18 of file net_address.h.
pp::NetAddress::NetAddress | ( | ) |
Default constructor for creating an is_null() NetAddress
object.
Definition at line 21 of file net_address.cc.
pp::NetAddress::NetAddress | ( | PassRef | , |
PP_Resource | resource | ||
) |
A constructor used when you have received a PP_Resource
as a return value that has had 1 ref added for you.
[in] | resource | A PPB_NetAddress resource. |
Definition at line 24 of file net_address.cc.
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.
[in] | instance | The instance with which this resource will be associated. |
[in] | ipv4_addr | An IPv4 address. |
Definition at line 28 of file net_address.cc.
References pp::Resource::PassRefFromConstructor(), and pp::InstanceHandle::pp_instance().
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.
[in] | instance | The instance with which this resource will be associated. |
[in] | ipv6_addr | An IPv6 address. |
Definition at line 37 of file net_address.cc.
References pp::Resource::PassRefFromConstructor(), and pp::InstanceHandle::pp_instance().
pp::NetAddress::NetAddress | ( | const NetAddress & | other | ) |
The copy constructor for NetAddress
.
[in] | other | A reference to another NetAddress . |
Definition at line 46 of file net_address.cc.
|
virtual |
The destructor.
Definition at line 49 of file net_address.cc.
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.
[out] | ipv4_addr | A PP_NetAddress_IPv4 structure to store the result. |
Definition at line 79 of file net_address.cc.
References pp::Resource::pp_resource().
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.
[out] | ipv6_addr | A PP_NetAddress_IPv6 structure to store the result. |
Definition at line 89 of file net_address.cc.
References pp::Resource::pp_resource().
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").
[in] | include_port | Whether to include the port number in the description. |
Definition at line 69 of file net_address.cc.
References pp::PASS_REF, pp::Resource::pp_resource(), and pp::Resource::Var.
PP_NetAddress_Family pp::NetAddress::GetFamily | ( | ) | const |
Gets the address family.
PP_NETADDRESS_FAMILY_UNSPECIFIED
on failure. Definition at line 62 of file net_address.cc.
References pp::Resource::pp_resource().
|
static |
Static function for determining whether the browser supports the PPB_NetAddress
interface.
Definition at line 58 of file net_address.cc.
NetAddress & pp::NetAddress::operator= | ( | const NetAddress & | other | ) |
The assignment operator for NetAddress
.
[in] | other | A reference to another NetAddress . |
NetAddress
object. Definition at line 52 of file net_address.cc.
References pp::Resource::operator=().