Pepper_42_C++_interfaces
Public Member Functions | Static Public Member Functions | List of all members
pp::NetAddress Class Reference

The NetAddress class represents a network address. More...

#include <net_address.h>

Inheritance diagram for pp::NetAddress:
Inheritance graph
Collaboration diagram for pp::NetAddress:
Collaboration graph

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...
 
NetAddressoperator= (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
 
- Public Member Functions inherited from pp::Resource
 Resource ()
 The default constructor. More...
 
 Resource (const Resource &other)
 
virtual ~Resource ()
 Destructor. More...
 
Resourceoperator= (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

- Protected Member Functions inherited from pp::Resource
 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...
 

Detailed Description

The NetAddress class represents a network address.

Definition at line 18 of file net_address.h.

Constructor & Destructor Documentation

pp::NetAddress::NetAddress ( )

Default constructor for creating an is_null() NetAddress object.

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.

Parameters
[in]resourceA 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]instanceThe instance with which this resource will be associated.
[in]ipv4_addrAn 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]instanceThe instance with which this resource will be associated.
[in]ipv6_addrAn IPv6 address.
pp::NetAddress::NetAddress ( const NetAddress other)

The copy constructor for NetAddress.

Parameters
[in]otherA reference to another NetAddress.
virtual pp::NetAddress::~NetAddress ( )
virtual

The destructor.

Member Function Documentation

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_addrA 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_addrA 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_portWhether 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.
NetAddress& pp::NetAddress::operator= ( const NetAddress other)

The assignment operator for NetAddress.

Parameters
[in]otherA reference to another NetAddress.
Returns
A reference to this NetAddress object.

The documentation for this class was generated from the following file: