chromium/native_client_sdk/doc_generated/pepper_dev/cpp/classpp_1_1_net_address.html

{{+bindTo:partials.standard_nacl_api}}
<h1>pp::NetAddress Class Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
  <div>
<!-- Generated by Doxygen 1.7.6.1 -->



</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="pp::NetAddress" --><!-- doxytag: inherits="pp::Resource" --><div class="dynheader">
Inheritance diagram for pp::NetAddress:</div>
<div class="dyncontent">
<div class="center"><img src="classpp_1_1_net_address__inherit__graph.png" border="0" usemap="#pp_1_1_net_address_inherit__map" alt="Inheritance graph" /></div>
<map name="pp_1_1_net_address_inherit__map" id="pp_1_1_net_address_inherit__map">
<area shape="rect" id="node2" href="classpp_1_1_resource.html" title="A reference counted module resource." alt="" coords="13,5,117,32"></area></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classpp_1_1_net_address-members.html">List of all members.</a></p>
<h2>
Public Member Functions</h2><table class="memberdecls">

<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#abe4887a33342dac27318079f07bb012d">NetAddress</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#ade2ad27841d2ccedbb202ee2c1eade14">NetAddress</a> (<a class="el" href="namespacepp.html#a339083c1beec620267bf8b3c55decaa5">PassRef</a>, PP_Resource resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#ae54044b80f97d259cb23b924a877ce53">NetAddress</a> (const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;instance, const PP_NetAddress_IPv4 &amp;ipv4_addr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#a76442610ed533079115a5150b7a9c98c">NetAddress</a> (const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;instance, const PP_NetAddress_IPv6 &amp;ipv6_addr)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#a8c0b559bd205387c199aba688c356298">NetAddress</a> (const <a class="el" href="classpp_1_1_net_address.html">NetAddress</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#a06b05fdecaf0b32ee74e7ebbb85a0674">~NetAddress</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_net_address.html">NetAddress</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#ab12bb266c9714d818aedc9cce7a209cf">operator=</a> (const <a class="el" href="classpp_1_1_net_address.html">NetAddress</a> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">PP_NetAddress_Family&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#a271533da67cd5c6f536c6595b439bd9b">GetFamily</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_var.html">Var</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#a9ff9ad19269af1c00ff02542397e92cc">DescribeAsString</a> (bool include_port) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#a3fdbd86db0384bf334dabcefa5e46237">DescribeAsIPv4Address</a> (PP_NetAddress_IPv4 *ipv4_addr) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#a81991279a52f8d38d9b75e1e607a81a5">DescribeAsIPv6Address</a> (PP_NetAddress_IPv6 *ipv6_addr) const </td></tr>
</table><h2>
Static Public Member Functions</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_net_address.html#a15547416a0b50b6ebd271ca421a91068">IsAvailable</a> ()</td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The <code><a class="el" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address.">NetAddress</a></code> class represents a network address. </p>
</div><hr /><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="abe4887a33342dac27318079f07bb012d"></a><!-- doxytag: member="pp::NetAddress::NetAddress" ref="abe4887a33342dac27318079f07bb012d" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_net_address.html#abe4887a33342dac27318079f07bb012d">pp::NetAddress::NetAddress</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Default constructor for creating an <a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9" title="This functions determines if this resource is invalid or uninitialized.">is_null()</a> <code><a class="el" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address.">NetAddress</a></code> object. </p>
</div>
</div>
<a class="anchor" id="ade2ad27841d2ccedbb202ee2c1eade14"></a><!-- doxytag: member="pp::NetAddress::NetAddress" ref="ade2ad27841d2ccedbb202ee2c1eade14" args="(PassRef, PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_net_address.html#abe4887a33342dac27318079f07bb012d">pp::NetAddress::NetAddress</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacepp.html#a339083c1beec620267bf8b3c55decaa5">PassRef</a>&#160;</td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">PP_Resource&#160;</td>
<td class="paramname"><em>resource</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A constructor used when you have received a <code>PP_Resource</code> as a return value that has had 1 ref added for you. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PPB_NetAddress</code> resource. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ae54044b80f97d259cb23b924a877ce53"></a><!-- doxytag: member="pp::NetAddress::NetAddress" ref="ae54044b80f97d259cb23b924a877ce53" args="(const InstanceHandle &amp;instance, const PP_NetAddress_IPv4 &amp;ipv4_addr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_net_address.html#abe4887a33342dac27318079f07bb012d">pp::NetAddress::NetAddress</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;&#160;</td>
<td class="paramname"><em>instance</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const PP_NetAddress_IPv4 &amp;&#160;</td>
<td class="paramname"><em>ipv4_addr</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A constructor used to create a <code><a class="el" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address.">NetAddress</a></code> object with the specified IPv4 address. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>The instance with which this resource will be associated. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">ipv4_addr</td><td>An IPv4 address. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a76442610ed533079115a5150b7a9c98c"></a><!-- doxytag: member="pp::NetAddress::NetAddress" ref="a76442610ed533079115a5150b7a9c98c" args="(const InstanceHandle &amp;instance, const PP_NetAddress_IPv6 &amp;ipv6_addr)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_net_address.html#abe4887a33342dac27318079f07bb012d">pp::NetAddress::NetAddress</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;&#160;</td>
<td class="paramname"><em>instance</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const PP_NetAddress_IPv6 &amp;&#160;</td>
<td class="paramname"><em>ipv6_addr</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A constructor used to create a <code><a class="el" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address.">NetAddress</a></code> object with the specified IPv6 address. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>The instance with which this resource will be associated. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">ipv6_addr</td><td>An IPv6 address. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a8c0b559bd205387c199aba688c356298"></a><!-- doxytag: member="pp::NetAddress::NetAddress" ref="a8c0b559bd205387c199aba688c356298" args="(const NetAddress &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_net_address.html#abe4887a33342dac27318079f07bb012d">pp::NetAddress::NetAddress</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_net_address.html">NetAddress</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The copy constructor for <code><a class="el" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address.">NetAddress</a></code>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A reference to another <code><a class="el" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address.">NetAddress</a></code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a06b05fdecaf0b32ee74e7ebbb85a0674"></a><!-- doxytag: member="pp::NetAddress::~NetAddress" ref="a06b05fdecaf0b32ee74e7ebbb85a0674" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classpp_1_1_net_address.html#a06b05fdecaf0b32ee74e7ebbb85a0674">pp::NetAddress::~NetAddress</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The destructor. </p>
</div>
</div>
<hr /><h2>Member Function Documentation</h2>
<a class="anchor" id="a3fdbd86db0384bf334dabcefa5e46237"></a><!-- doxytag: member="pp::NetAddress::DescribeAsIPv4Address" ref="a3fdbd86db0384bf334dabcefa5e46237" args="(PP_NetAddress_IPv4 *ipv4_addr) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classpp_1_1_net_address.html#a3fdbd86db0384bf334dabcefa5e46237">pp::NetAddress::DescribeAsIPv4Address</a> </td>
<td>(</td>
<td class="paramtype">PP_NetAddress_IPv4 *&#160;</td>
<td class="paramname"><em>ipv4_addr</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Fills a <code>PP_NetAddress_IPv4</code> structure if the network address is of <code>PP_NETADDRESS_FAMILY_IPV4</code> address family. </p>
<p>Note that passing a network address of <code>PP_NETADDRESS_FAMILY_IPV6</code> address family will fail even if the address is an IPv4-mapped IPv6 address.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">ipv4_addr</td><td>A <code>PP_NetAddress_IPv4</code> structure to store the result.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A boolean value indicating whether the operation succeeded. </dd></dl>
</div>
</div>
<a class="anchor" id="a81991279a52f8d38d9b75e1e607a81a5"></a><!-- doxytag: member="pp::NetAddress::DescribeAsIPv6Address" ref="a81991279a52f8d38d9b75e1e607a81a5" args="(PP_NetAddress_IPv6 *ipv6_addr) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classpp_1_1_net_address.html#a81991279a52f8d38d9b75e1e607a81a5">pp::NetAddress::DescribeAsIPv6Address</a> </td>
<td>(</td>
<td class="paramtype">PP_NetAddress_IPv6 *&#160;</td>
<td class="paramname"><em>ipv6_addr</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Fills a <code>PP_NetAddress_IPv6</code> structure if the network address is of <code>PP_NETADDRESS_FAMILY_IPV6</code> address family. </p>
<p>Note that passing a network address of <code>PP_NETADDRESS_FAMILY_IPV4</code> address family will fail - this method doesn't map it to an IPv6 address.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">ipv6_addr</td><td>A <code>PP_NetAddress_IPv6</code> structure to store the result.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A boolean value indicating whether the operation succeeded. </dd></dl>
</div>
</div>
<a class="anchor" id="a9ff9ad19269af1c00ff02542397e92cc"></a><!-- doxytag: member="pp::NetAddress::DescribeAsString" ref="a9ff9ad19269af1c00ff02542397e92cc" args="(bool include_port) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_var.html">Var</a> <a class="el" href="classpp_1_1_net_address.html#a9ff9ad19269af1c00ff02542397e92cc">pp::NetAddress::DescribeAsString</a> </td>
<td>(</td>
<td class="paramtype">bool&#160;</td>
<td class="paramname"><em>include_port</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns a human-readable description of the network address. </p>
<p>The description is in the form of host [ ":" port ] and conforms to <a href="http://tools.ietf.org/html/rfc3986#section-3.2">http://tools.ietf.org/html/rfc3986#section-3.2</a> for IPv4 and IPv6 addresses (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80").</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">include_port</td><td>Whether to include the port number in the description.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A string <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code> on success; an undefined <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code> on failure. </dd></dl>
</div>
</div>
<a class="anchor" id="a271533da67cd5c6f536c6595b439bd9b"></a><!-- doxytag: member="pp::NetAddress::GetFamily" ref="a271533da67cd5c6f536c6595b439bd9b" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PP_NetAddress_Family <a class="el" href="classpp_1_1_net_address.html#a271533da67cd5c6f536c6595b439bd9b">pp::NetAddress::GetFamily</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the address family. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The address family on success; <code>PP_NETADDRESS_FAMILY_UNSPECIFIED</code> on failure. </dd></dl>
</div>
</div>
<a class="anchor" id="a15547416a0b50b6ebd271ca421a91068"></a><!-- doxytag: member="pp::NetAddress::IsAvailable" ref="a15547416a0b50b6ebd271ca421a91068" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static bool <a class="el" href="classpp_1_1_net_address.html#a15547416a0b50b6ebd271ca421a91068">pp::NetAddress::IsAvailable</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Static function for determining whether the browser supports the <code>PPB_NetAddress</code> interface. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the interface is available, false otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="ab12bb266c9714d818aedc9cce7a209cf"></a><!-- doxytag: member="pp::NetAddress::operator=" ref="ab12bb266c9714d818aedc9cce7a209cf" args="(const NetAddress &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_net_address.html">NetAddress</a>&amp; pp::NetAddress::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_net_address.html">NetAddress</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The assignment operator for <code><a class="el" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address.">NetAddress</a></code>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A reference to another <code><a class="el" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address.">NetAddress</a></code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A reference to this <code><a class="el" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address.">NetAddress</a></code> object. </dd></dl>
</div>
</div>
<hr />The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="net__address_8h.html">net_address.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}