1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qnetworkinterface.cpp -->
<title>Qt 4.8: QNetworkAddressEntry Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtnetwork.html">QtNetwork</a></li>
<li>QNetworkAddressEntry</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QNetworkAddressEntry Class Reference</h1>
<!-- $$$QNetworkAddressEntry-brief -->
<p>The QNetworkAddressEntry class stores one IP address supported by a network interface, along with its associated netmask and broadcast address. <a href="#details">More...</a></p>
<!-- @@@QNetworkAddressEntry -->
<pre class="cpp"> <span class="preprocessor">#include <QNetworkAddressEntry></span></pre><p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qnetworkaddressentry-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#QNetworkAddressEntry">QNetworkAddressEntry</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#QNetworkAddressEntry-2">QNetworkAddressEntry</a></b> ( const QNetworkAddressEntry & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#dtor.QNetworkAddressEntry">~QNetworkAddressEntry</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#broadcast">broadcast</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#ip">ip</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#netmask">netmask</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#prefixLength">prefixLength</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#setBroadcast">setBroadcast</a></b> ( const QHostAddress & <i>newBroadcast</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#setIp">setIp</a></b> ( const QHostAddress & <i>newIp</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#setNetmask">setNetmask</a></b> ( const QHostAddress & <i>newNetmask</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#setPrefixLength">setPrefixLength</a></b> ( int <i>length</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#operator-not-eq">operator!=</a></b> ( const QNetworkAddressEntry & <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkAddressEntry & </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#operator-eq">operator=</a></b> ( const QNetworkAddressEntry & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#operator-eq-eq">operator==</a></b> ( const QNetworkAddressEntry & <i>other</i> ) const</td></tr>
</table>
<a name="details"></a>
<!-- $$$QNetworkAddressEntry-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QNetworkAddressEntry class stores one IP address supported by a network interface, along with its associated netmask and broadcast address.</p>
<p>Each network interface can contain zero or more IP addresses, which in turn can be associated with a netmask and/or a broadcast address (depending on support from the operating system).</p>
<p>This class represents one such group.</p>
</div>
<!-- @@@QNetworkAddressEntry -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QNetworkAddressEntry[overload1]$$$QNetworkAddressEntry -->
<h3 class="fn"><a name="QNetworkAddressEntry"></a>QNetworkAddressEntry::<span class="name">QNetworkAddressEntry</span> ()</h3>
<p>Constructs an empty <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object.</p>
<!-- @@@QNetworkAddressEntry -->
<!-- $$$QNetworkAddressEntry$$$QNetworkAddressEntryconstQNetworkAddressEntry& -->
<h3 class="fn"><a name="QNetworkAddressEntry-2"></a>QNetworkAddressEntry::<span class="name">QNetworkAddressEntry</span> ( const <span class="type">QNetworkAddressEntry</span> & <i>other</i> )</h3>
<p>Constructs a <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object that is a copy of the object <i>other</i>.</p>
<!-- @@@QNetworkAddressEntry -->
<!-- $$$~QNetworkAddressEntry[overload1]$$$~QNetworkAddressEntry -->
<h3 class="fn"><a name="dtor.QNetworkAddressEntry"></a>QNetworkAddressEntry::<span class="name">~QNetworkAddressEntry</span> ()</h3>
<p>Destroys this <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object.</p>
<!-- @@@~QNetworkAddressEntry -->
<!-- $$$broadcast[overload1]$$$broadcast -->
<h3 class="fn"><a name="broadcast"></a><span class="type"><a href="qhostaddress.html">QHostAddress</a></span> QNetworkAddressEntry::<span class="name">broadcast</span> () const</h3>
<p>Returns the broadcast address associated with the IPv4 address and netmask. It can usually be derived from those two by setting to 1 the bits of the IP address where the netmask contains a 0. (In other words, by bitwise-OR'ing the IP address with the inverse of the netmask)</p>
<p>This member is always empty for IPv6 addresses, since the concept of broadcast has been abandoned in that system in favor of multicast. In particular, the group of hosts corresponding to all the nodes in the local network can be reached by the "all-nodes" special multicast group (address FF02::1).</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#setBroadcast">setBroadcast</a>().</p>
<!-- @@@broadcast -->
<!-- $$$ip[overload1]$$$ip -->
<h3 class="fn"><a name="ip"></a><span class="type"><a href="qhostaddress.html">QHostAddress</a></span> QNetworkAddressEntry::<span class="name">ip</span> () const</h3>
<p>This function returns one IPv4 or IPv6 address found, that was found in a network interface.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#setIp">setIp</a>().</p>
<!-- @@@ip -->
<!-- $$$netmask[overload1]$$$netmask -->
<h3 class="fn"><a name="netmask"></a><span class="type"><a href="qhostaddress.html">QHostAddress</a></span> QNetworkAddressEntry::<span class="name">netmask</span> () const</h3>
<p>Returns the netmask associated with the IP address. The netmask is expressed in the form of an IP address, such as 255.255.0.0.</p>
<p>For IPv6 addresses, the prefix length is converted to an address where the number of bits set to 1 is equal to the prefix length. For a prefix length of 64 bits (the most common value), the netmask will be expressed as a <a href="qhostaddress.html">QHostAddress</a> holding the address FFFF:FFFF:FFFF:FFFF::</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#setNetmask">setNetmask</a>() and <a href="qnetworkaddressentry.html#prefixLength">prefixLength</a>().</p>
<!-- @@@netmask -->
<!-- $$$prefixLength[overload1]$$$prefixLength -->
<h3 class="fn"><a name="prefixLength"></a><span class="type">int</span> QNetworkAddressEntry::<span class="name">prefixLength</span> () const</h3>
<p>Returns the prefix length of this IP address. The prefix length matches the number of bits set to 1 in the netmask (see <a href="qnetworkaddressentry.html#netmask">netmask</a>()). For IPv4 addresses, the value is between 0 and 32. For IPv6 addresses, it's contained between 0 and 128 and is the preferred form of representing addresses.</p>
<p>This function returns -1 if the prefix length could not be determined (i.e., <a href="qnetworkaddressentry.html#netmask">netmask</a>() returns a null QHostAddress()).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#setPrefixLength">setPrefixLength</a>() and <a href="qnetworkaddressentry.html#netmask">netmask</a>().</p>
<!-- @@@prefixLength -->
<!-- $$$setBroadcast[overload1]$$$setBroadcastconstQHostAddress& -->
<h3 class="fn"><a name="setBroadcast"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">setBroadcast</span> ( const <span class="type"><a href="qhostaddress.html">QHostAddress</a></span> & <i>newBroadcast</i> )</h3>
<p>Sets the broadcast IP address of this <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object to <i>newBroadcast</i>.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#broadcast">broadcast</a>().</p>
<!-- @@@setBroadcast -->
<!-- $$$setIp[overload1]$$$setIpconstQHostAddress& -->
<h3 class="fn"><a name="setIp"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">setIp</span> ( const <span class="type"><a href="qhostaddress.html">QHostAddress</a></span> & <i>newIp</i> )</h3>
<p>Sets the IP address the <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object contains to <i>newIp</i>.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#ip">ip</a>().</p>
<!-- @@@setIp -->
<!-- $$$setNetmask[overload1]$$$setNetmaskconstQHostAddress& -->
<h3 class="fn"><a name="setNetmask"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">setNetmask</span> ( const <span class="type"><a href="qhostaddress.html">QHostAddress</a></span> & <i>newNetmask</i> )</h3>
<p>Sets the netmask that this <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object contains to <i>newNetmask</i>. Setting the netmask also sets the prefix length to match the new netmask.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#netmask">netmask</a>() and <a href="qnetworkaddressentry.html#setPrefixLength">setPrefixLength</a>().</p>
<!-- @@@setNetmask -->
<!-- $$$setPrefixLength[overload1]$$$setPrefixLengthint -->
<h3 class="fn"><a name="setPrefixLength"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">setPrefixLength</span> ( <span class="type">int</span> <i>length</i> )</h3>
<p>Sets the prefix length of this IP address to <i>length</i>. The value of <i>length</i> must be valid for this type of IP address: between 0 and 32 for IPv4 addresses, between 0 and 128 for IPv6 addresses. Setting to any invalid value is equivalent to setting to -1, which means "no prefix length".</p>
<p>Setting the prefix length also sets the netmask (see <a href="qnetworkaddressentry.html#netmask">netmask</a>()).</p>
<p>This function was introduced in Qt 4.5.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#prefixLength">prefixLength</a>() and <a href="qnetworkaddressentry.html#setNetmask">setNetmask</a>().</p>
<!-- @@@setPrefixLength -->
<!-- $$$operator!=[overload1]$$$operator!=constQNetworkAddressEntry& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QNetworkAddressEntry::<span class="name">operator!=</span> ( const <span class="type">QNetworkAddressEntry</span> & <i>other</i> ) const</h3>
<p>Returns true if this network address entry is different from <i>other</i>.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQNetworkAddressEntry& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QNetworkAddressEntry</span> & QNetworkAddressEntry::<span class="name">operator=</span> ( const <span class="type">QNetworkAddressEntry</span> & <i>other</i> )</h3>
<p>Makes a copy of the <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object <i>other</i>.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQNetworkAddressEntry& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QNetworkAddressEntry::<span class="name">operator==</span> ( const <span class="type">QNetworkAddressEntry</span> & <i>other</i> ) const</h3>
<p>Returns true if this network address entry is the same as <i>other</i>.</p>
<!-- @@@operator== -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|