[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/tools/qbitarray.cpp:83 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QBitArray Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QBitArray Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QBitArray class provides an array of bits.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p>All the functions in this class are <a href="threads.html#reentrant">reentrant</a> when Qt is built with thread support.</p>
|
---|
| 37 | <p><tt>#include <<a href="qbitarray-h.html">qbitarray.h</a>></tt>
|
---|
| 38 | <p>Inherits <a href="qbytearray.html">QByteArray</a>.
|
---|
| 39 | <p><a href="qbitarray-members.html">List of all member functions.</a>
|
---|
| 40 | <h2>Public Members</h2>
|
---|
| 41 | <ul>
|
---|
| 42 | <li class=fn><a href="#QBitArray"><b>QBitArray</b></a> ()</li>
|
---|
| 43 | <li class=fn><a href="#QBitArray-2"><b>QBitArray</b></a> ( uint size )</li>
|
---|
| 44 | <li class=fn><a href="#QBitArray-3"><b>QBitArray</b></a> ( const QBitArray & a )</li>
|
---|
| 45 | <li class=fn>QBitArray & <a href="#operator-eq"><b>operator=</b></a> ( const QBitArray & a )</li>
|
---|
| 46 | <li class=fn>uint <a href="#size"><b>size</b></a> () const</li>
|
---|
| 47 | <li class=fn>bool <a href="#resize"><b>resize</b></a> ( uint size )</li>
|
---|
| 48 | <li class=fn>bool <a href="#fill"><b>fill</b></a> ( bool v, int size = -1 )</li>
|
---|
| 49 | <li class=fn>virtual void <a href="#detach"><b>detach</b></a> ()</li>
|
---|
| 50 | <li class=fn>QBitArray <a href="#copy"><b>copy</b></a> () const</li>
|
---|
| 51 | <li class=fn>bool <a href="#testBit"><b>testBit</b></a> ( uint index ) const</li>
|
---|
| 52 | <li class=fn>void <a href="#setBit-2"><b>setBit</b></a> ( uint index )</li>
|
---|
| 53 | <li class=fn>void <a href="#setBit"><b>setBit</b></a> ( uint index, bool value )</li>
|
---|
| 54 | <li class=fn>void <a href="#clearBit"><b>clearBit</b></a> ( uint index )</li>
|
---|
| 55 | <li class=fn>bool <a href="#toggleBit"><b>toggleBit</b></a> ( uint index )</li>
|
---|
| 56 | <li class=fn>bool <a href="#at"><b>at</b></a> ( uint index ) const</li>
|
---|
| 57 | <li class=fn>QBitVal <a href="#operator[]"><b>operator[]</b></a> ( int index )</li>
|
---|
| 58 | <li class=fn>bool <a href="#operator[]-2"><b>operator[]</b></a> ( int index ) const</li>
|
---|
| 59 | <li class=fn>QBitArray & <a href="#operator-and-eq"><b>operator&=</b></a> ( const QBitArray & a )</li>
|
---|
| 60 | <li class=fn>QBitArray & <a href="#operator|-eq"><b>operator|=</b></a> ( const QBitArray & a )</li>
|
---|
| 61 | <li class=fn>QBitArray & <a href="#operator^-eq"><b>operator^=</b></a> ( const QBitArray & a )</li>
|
---|
| 62 | <li class=fn>QBitArray <a href="#operator~"><b>operator~</b></a> () const</li>
|
---|
| 63 | </ul>
|
---|
| 64 | <h2>Related Functions</h2>
|
---|
| 65 | <ul>
|
---|
| 66 | <li class=fn>QBitArray <a href="#operator-and"><b>operator&</b></a> ( const QBitArray & a1, const QBitArray & a2 )</li>
|
---|
| 67 | <li class=fn>QBitArray <a href="#operator|"><b>operator|</b></a> ( const QBitArray & a1, const QBitArray & a2 )</li>
|
---|
| 68 | <li class=fn>QBitArray <a href="#operator^"><b>operator^</b></a> ( const QBitArray & a1, const QBitArray & a2 )</li>
|
---|
| 69 | <li class=fn>QDataStream & <a href="#operator-lt-lt"><b>operator<<</b></a> ( QDataStream & s, const QBitArray & a )</li>
|
---|
| 70 | <li class=fn>QDataStream & <a href="#operator-gt-gt"><b>operator>></b></a> ( QDataStream & s, QBitArray & a )</li>
|
---|
| 71 | </ul>
|
---|
| 72 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 73 |
|
---|
| 74 |
|
---|
| 75 |
|
---|
| 76 | The QBitArray class provides an array of bits.
|
---|
| 77 | <p>
|
---|
| 78 |
|
---|
| 79 |
|
---|
| 80 | <p> Because QBitArray is a <a href="qmemarray.html">QMemArray</a>, it uses explicit <a href="shclass.html">sharing</a> with a reference count.
|
---|
| 81 | <p> A QBitArray is a special byte array that can access individual
|
---|
| 82 | bits and perform bit-operations (AND, OR, XOR and NOT) on entire
|
---|
| 83 | arrays or bits.
|
---|
| 84 | <p> Bits can be manipulated by the <a href="#setBit">setBit</a>() and <a href="#clearBit">clearBit</a>() functions,
|
---|
| 85 | but it is also possible to use the indexing [] operator to test
|
---|
| 86 | and set individual bits. The [] operator is a little slower than
|
---|
| 87 | setBit() and clearBit() because some tricks are required to
|
---|
| 88 | implement single-bit assignments.
|
---|
| 89 | <p> Example:
|
---|
| 90 | <pre>
|
---|
| 91 | QBitArray a(3);
|
---|
| 92 | a.<a href="#setBit">setBit</a>( 0 );
|
---|
| 93 | a.<a href="#clearBit">clearBit</a>( 1 );
|
---|
| 94 | a.<a href="#setBit">setBit</a>( 2 ); // a = [1 0 1]
|
---|
| 95 |
|
---|
| 96 | QBitArray b(3);
|
---|
| 97 | b[0] = 1;
|
---|
| 98 | b[1] = 1;
|
---|
| 99 | b[2] = 0; // b = [1 1 0]
|
---|
| 100 |
|
---|
| 101 | QBitArray c;
|
---|
| 102 | c = ~a & b; // c = [0 1 0]
|
---|
| 103 | </pre>
|
---|
| 104 |
|
---|
| 105 | <p> When a QBitArray is constructed the bits are uninitialized. Use
|
---|
| 106 | <a href="#fill">fill</a>() to set all the bits to 0 or 1. The array can be resized
|
---|
| 107 | with <a href="#resize">resize</a>() and copied with <a href="#copy">copy</a>(). Bits can be set with
|
---|
| 108 | setBit() and cleared with clearBit(). Bits can be toggled with
|
---|
| 109 | <a href="#toggleBit">toggleBit</a>(). A bit's value can be obtained with <a href="#testBit">testBit</a>() and with
|
---|
| 110 | <a href="#at">at</a>().
|
---|
| 111 | <p> QBitArray supports the & (AND), | (OR), ^ (XOR) and ~ (NOT)
|
---|
| 112 | operators.
|
---|
| 113 | <p>See also <a href="collection.html">Collection Classes</a>, <a href="shared.html">Implicitly and Explicitly Shared Classes</a>, and <a href="tools.html">Non-GUI Classes</a>.
|
---|
| 114 |
|
---|
| 115 | <hr><h2>Member Function Documentation</h2>
|
---|
| 116 | <h3 class=fn><a name="QBitArray"></a>QBitArray::QBitArray ()
|
---|
| 117 | </h3>
|
---|
| 118 | Constructs an empty bit array.
|
---|
| 119 |
|
---|
| 120 | <h3 class=fn><a name="QBitArray-2"></a>QBitArray::QBitArray ( uint size )
|
---|
| 121 | </h3>
|
---|
| 122 | Constructs a bit array of <em>size</em> bits. The bits are uninitialized.
|
---|
| 123 | <p> <p>See also <a href="#fill">fill</a>().
|
---|
| 124 |
|
---|
| 125 | <h3 class=fn><a name="QBitArray-3"></a>QBitArray::QBitArray ( const <a href="qbitarray.html">QBitArray</a> & a )
|
---|
| 126 | </h3>
|
---|
| 127 |
|
---|
| 128 | <p> Constructs a <a href="shclass.html#shallow-copy">shallow copy</a> of <em>a</em>.
|
---|
| 129 |
|
---|
| 130 | <h3 class=fn>bool <a name="at"></a>QBitArray::at ( uint index ) const
|
---|
| 131 | </h3>
|
---|
| 132 |
|
---|
| 133 | <p> Returns the value (0 or 1) of the bit at position <em>index</em>.
|
---|
| 134 | <p> <p>See also <a href="#operator[]">operator[]</a>().
|
---|
| 135 |
|
---|
| 136 | <h3 class=fn>void <a name="clearBit"></a>QBitArray::clearBit ( uint index )
|
---|
| 137 | </h3>
|
---|
| 138 | Clears the bit at position <em>index</em>, i.e. sets it to 0.
|
---|
| 139 | <p> <p>See also <a href="#setBit">setBit</a>() and <a href="#toggleBit">toggleBit</a>().
|
---|
| 140 |
|
---|
| 141 | <h3 class=fn><a href="qbitarray.html">QBitArray</a> <a name="copy"></a>QBitArray::copy () const
|
---|
| 142 | </h3>
|
---|
| 143 | Returns a <a href="shclass.html#deep-copy">deep copy</a> of the bit array.
|
---|
| 144 | <p> <p>See also <a href="#detach">detach</a>().
|
---|
| 145 |
|
---|
| 146 | <h3 class=fn>void <a name="detach"></a>QBitArray::detach ()<tt> [virtual]</tt>
|
---|
| 147 | </h3>
|
---|
| 148 | Detaches from shared bit array data and makes sure that this bit
|
---|
| 149 | array is the only one referring to the data.
|
---|
| 150 | <p> If multiple bit arrays share common data, this bit array
|
---|
| 151 | dereferences the data and gets a copy of the data. Nothing happens
|
---|
| 152 | if there is only a single reference.
|
---|
| 153 | <p> <p>See also <a href="#copy">copy</a>().
|
---|
| 154 |
|
---|
| 155 | <p>Reimplemented from <a href="qmemarray.html#detach">QMemArray</a>.
|
---|
| 156 | <h3 class=fn>bool <a name="fill"></a>QBitArray::fill ( bool v, int size = -1 )
|
---|
| 157 | </h3>
|
---|
| 158 | Fills the bit array with <em>v</em> (1's if <em>v</em> is TRUE, or 0's if <em>v</em>
|
---|
| 159 | is FALSE).
|
---|
| 160 | <p> <a href="#fill">fill</a>() resizes the bit array to <em>size</em> bits if <em>size</em> is
|
---|
| 161 | nonnegative.
|
---|
| 162 | <p> Returns FALSE if a nonnegative <em>size</em> was specified and the bit
|
---|
| 163 | array could not be resized; otherwise returns TRUE.
|
---|
| 164 | <p> <p>See also <a href="#resize">resize</a>().
|
---|
| 165 |
|
---|
| 166 | <h3 class=fn><a href="qbitarray.html">QBitArray</a> & <a name="operator-and-eq"></a>QBitArray::operator&= ( const <a href="qbitarray.html">QBitArray</a> & a )
|
---|
| 167 | </h3>
|
---|
| 168 | Performs the AND operation between all bits in this bit array and
|
---|
| 169 | <em>a</em>. Returns a reference to this bit array.
|
---|
| 170 | <p> The result has the length of the longest of the two bit arrays,
|
---|
| 171 | with any missing bits (i.e. if one array is shorter than the
|
---|
| 172 | other), taken to be 0.
|
---|
| 173 | <pre>
|
---|
| 174 | QBitArray a( 3 ), b( 2 );
|
---|
| 175 | a[0] = 1; a[1] = 0; a[2] = 1; // a = [1 0 1]
|
---|
| 176 | b[0] = 1; b[1] = 0; // b = [1 0]
|
---|
| 177 | a &= b; // a = [1 0 0]
|
---|
| 178 | </pre>
|
---|
| 179 |
|
---|
| 180 | <p> <p>See also <a href="#operator|-eq">operator|=</a>(), <a href="#operator^-eq">operator^=</a>(), and <a href="#operator~">operator~</a>().
|
---|
| 181 |
|
---|
| 182 | <h3 class=fn><a href="qbitarray.html">QBitArray</a> & <a name="operator-eq"></a>QBitArray::operator= ( const <a href="qbitarray.html">QBitArray</a> & a )
|
---|
| 183 | </h3>
|
---|
| 184 |
|
---|
| 185 | <p> Assigns a <a href="shclass.html#shallow-copy">shallow copy</a> of <em>a</em> to this bit array and returns a
|
---|
| 186 | reference to this array.
|
---|
| 187 |
|
---|
| 188 | <h3 class=fn><a href="qbitval.html">QBitVal</a> <a name="operator[]"></a>QBitArray::operator[] ( int index )
|
---|
| 189 | </h3>
|
---|
| 190 |
|
---|
| 191 | <p> Implements the [] operator for bit arrays.
|
---|
| 192 | <p> The returned <a href="qbitval.html">QBitVal</a> is a context object. It makes it possible to
|
---|
| 193 | get and set a single bit value by its <em>index</em> position.
|
---|
| 194 | <p> Example:
|
---|
| 195 | <pre>
|
---|
| 196 | QBitArray a( 3 );
|
---|
| 197 | a[0] = 0;
|
---|
| 198 | a[1] = 1;
|
---|
| 199 | a[2] = a[0] ^ a[1];
|
---|
| 200 | </pre>
|
---|
| 201 |
|
---|
| 202 | <p> The functions <a href="#testBit">testBit</a>(), <a href="#setBit">setBit</a>() and <a href="#clearBit">clearBit</a>() are faster.
|
---|
| 203 | <p> <p>See also <a href="#at">at</a>().
|
---|
| 204 |
|
---|
| 205 | <h3 class=fn>bool <a name="operator[]-2"></a>QBitArray::operator[] ( int index ) const
|
---|
| 206 | </h3>
|
---|
| 207 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 208 | <p> Implements the [] operator for constant bit arrays.
|
---|
| 209 |
|
---|
| 210 | <h3 class=fn><a href="qbitarray.html">QBitArray</a> & <a name="operator^-eq"></a>QBitArray::operator^= ( const <a href="qbitarray.html">QBitArray</a> & a )
|
---|
| 211 | </h3>
|
---|
| 212 | Performs the XOR operation between all bits in this bit array and
|
---|
| 213 | <em>a</em>. Returns a reference to this bit array.
|
---|
| 214 | <p> The result has the length of the longest of the two bit arrays,
|
---|
| 215 | with any missing bits (i.e. if one array is shorter than the
|
---|
| 216 | other), taken to be 0.
|
---|
| 217 | <pre>
|
---|
| 218 | QBitArray a( 3 ), b( 2 );
|
---|
| 219 | a[0] = 1; a[1] = 0; a[2] = 1; // a = [1 0 1]
|
---|
| 220 | b[0] = 1; b[1] = 0; // b = [1 0]
|
---|
| 221 | a ^= b; // a = [0 0 1]
|
---|
| 222 | </pre>
|
---|
| 223 |
|
---|
| 224 | <p> <p>See also <a href="#operator-and-eq">operator&=</a>(), <a href="#operator|-eq">operator|=</a>(), and <a href="#operator~">operator~</a>().
|
---|
| 225 |
|
---|
| 226 | <h3 class=fn><a href="qbitarray.html">QBitArray</a> & <a name="operator|-eq"></a>QBitArray::operator|= ( const <a href="qbitarray.html">QBitArray</a> & a )
|
---|
| 227 | </h3>
|
---|
| 228 | Performs the OR operation between all bits in this bit array and
|
---|
| 229 | <em>a</em>. Returns a reference to this bit array.
|
---|
| 230 | <p> The result has the length of the longest of the two bit arrays,
|
---|
| 231 | with any missing bits (i.e. if one array is shorter than the
|
---|
| 232 | other), taken to be 0.
|
---|
| 233 | <pre>
|
---|
| 234 | QBitArray a( 3 ), b( 2 );
|
---|
| 235 | a[0] = 1; a[1] = 0; a[2] = 1; // a = [1 0 1]
|
---|
| 236 | b[0] = 1; b[1] = 0; // b = [1 0]
|
---|
| 237 | a |= b; // a = [1 0 1]
|
---|
| 238 | </pre>
|
---|
| 239 |
|
---|
| 240 | <p> <p>See also <a href="#operator-and-eq">operator&=</a>(), <a href="#operator^-eq">operator^=</a>(), and <a href="#operator~">operator~</a>().
|
---|
| 241 |
|
---|
| 242 | <h3 class=fn><a href="qbitarray.html">QBitArray</a> <a name="operator~"></a>QBitArray::operator~ () const
|
---|
| 243 | </h3>
|
---|
| 244 | Returns a bit array that contains the inverted bits of this bit array.
|
---|
| 245 | <p> Example:
|
---|
| 246 | <pre>
|
---|
| 247 | QBitArray a( 3 ), b;
|
---|
| 248 | a[0] = 1; a[1] = 0; a[2] = 1; // a = [1 0 1]
|
---|
| 249 | b = ~a; // b = [0 1 0]
|
---|
| 250 | </pre>
|
---|
| 251 |
|
---|
| 252 |
|
---|
| 253 | <h3 class=fn>bool <a name="resize"></a>QBitArray::resize ( uint size )
|
---|
| 254 | </h3>
|
---|
| 255 | Resizes the bit array to <em>size</em> bits and returns TRUE if the bit
|
---|
| 256 | array could be resized; otherwise returns FALSE. The array becomes
|
---|
| 257 | a null array if <em>size</em> == 0.
|
---|
| 258 | <p> If the array is expanded, the new bits are set to 0.
|
---|
| 259 | <p> <p>See also <a href="#size">size</a>().
|
---|
| 260 |
|
---|
| 261 | <h3 class=fn>void <a name="setBit"></a>QBitArray::setBit ( uint index, bool value )
|
---|
| 262 | </h3>
|
---|
| 263 |
|
---|
| 264 | <p> Sets the bit at position <em>index</em> to <em>value</em>.
|
---|
| 265 | <p> Equivalent to:
|
---|
| 266 | <pre>
|
---|
| 267 | if ( value )
|
---|
| 268 | <a href="#setBit">setBit</a>( index );
|
---|
| 269 | else
|
---|
| 270 | <a href="#clearBit">clearBit</a>( index );
|
---|
| 271 | </pre>
|
---|
| 272 |
|
---|
| 273 | <p> <p>See also <a href="#clearBit">clearBit</a>() and <a href="#toggleBit">toggleBit</a>().
|
---|
| 274 |
|
---|
| 275 | <h3 class=fn>void <a name="setBit-2"></a>QBitArray::setBit ( uint index )
|
---|
| 276 | </h3>
|
---|
| 277 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 278 | <p> Sets the bit at position <em>index</em> to 1.
|
---|
| 279 | <p> <p>See also <a href="#clearBit">clearBit</a>() and <a href="#toggleBit">toggleBit</a>().
|
---|
| 280 |
|
---|
| 281 | <h3 class=fn>uint <a name="size"></a>QBitArray::size () const
|
---|
| 282 | </h3>
|
---|
| 283 |
|
---|
| 284 | <p> Returns the bit array's size (number of bits).
|
---|
| 285 | <p> <p>See also <a href="#resize">resize</a>().
|
---|
| 286 |
|
---|
| 287 | <h3 class=fn>bool <a name="testBit"></a>QBitArray::testBit ( uint index ) const
|
---|
| 288 | </h3>
|
---|
| 289 | Returns TRUE if the bit at position <em>index</em> is set, i.e. is 1;
|
---|
| 290 | otherwise returns FALSE.
|
---|
| 291 | <p> <p>See also <a href="#setBit">setBit</a>() and <a href="#clearBit">clearBit</a>().
|
---|
| 292 |
|
---|
| 293 | <h3 class=fn>bool <a name="toggleBit"></a>QBitArray::toggleBit ( uint index )
|
---|
| 294 | </h3>
|
---|
| 295 | Toggles the bit at position <em>index</em>.
|
---|
| 296 | <p> If the previous value was 0, the new value will be 1. If the
|
---|
| 297 | previous value was 1, the new value will be 0.
|
---|
| 298 | <p> <p>See also <a href="#setBit">setBit</a>() and <a href="#clearBit">clearBit</a>().
|
---|
| 299 |
|
---|
| 300 | <hr><h2>Related Functions</h2>
|
---|
| 301 | <h3 class=fn><a href="qbitarray.html">QBitArray</a> <a name="operator-and"></a>operator& ( const <a href="qbitarray.html">QBitArray</a> & a1, const <a href="qbitarray.html">QBitArray</a> & a2 )
|
---|
| 302 | </h3>
|
---|
| 303 |
|
---|
| 304 | <p> Returns the AND result between the bit arrays <em>a1</em> and <em>a2</em>.
|
---|
| 305 | <p> The result has the length of the longest of the two bit arrays,
|
---|
| 306 | with any missing bits (i.e. if one array is shorter than the
|
---|
| 307 | other), taken to be 0.
|
---|
| 308 | <p> <p>See also <a href="#operator-and-eq">QBitArray::operator&=</a>().
|
---|
| 309 |
|
---|
| 310 | <h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-lt-lt"></a>operator<< ( <a href="qdatastream.html">QDataStream</a> & s, const <a href="qbitarray.html">QBitArray</a> & a )
|
---|
| 311 | </h3>
|
---|
| 312 |
|
---|
| 313 | <p> Writes bit array <em>a</em> to stream <em>s</em>.
|
---|
| 314 | <p> <p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>.
|
---|
| 315 |
|
---|
| 316 | <h3 class=fn><a href="qdatastream.html">QDataStream</a> & <a name="operator-gt-gt"></a>operator>> ( <a href="qdatastream.html">QDataStream</a> & s, <a href="qbitarray.html">QBitArray</a> & a )
|
---|
| 317 | </h3>
|
---|
| 318 |
|
---|
| 319 | <p> Reads a bit array into <em>a</em> from stream <em>s</em>.
|
---|
| 320 | <p> <p>See also <a href="datastreamformat.html">Format of the QDataStream operators</a>.
|
---|
| 321 |
|
---|
| 322 | <h3 class=fn><a href="qbitarray.html">QBitArray</a> <a name="operator^"></a>operator^ ( const <a href="qbitarray.html">QBitArray</a> & a1, const <a href="qbitarray.html">QBitArray</a> & a2 )
|
---|
| 323 | </h3>
|
---|
| 324 |
|
---|
| 325 | <p> Returns the XOR result between the bit arrays <em>a1</em> and <em>a2</em>.
|
---|
| 326 | <p> The result has the length of the longest of the two bit arrays,
|
---|
| 327 | with any missing bits (i.e. if one array is shorter than the
|
---|
| 328 | other), taken to be 0.
|
---|
| 329 | <p> <p>See also <a href="#operator^">QBitArray::operator^</a>().
|
---|
| 330 |
|
---|
| 331 | <h3 class=fn><a href="qbitarray.html">QBitArray</a> <a name="operator|"></a>operator| ( const <a href="qbitarray.html">QBitArray</a> & a1, const <a href="qbitarray.html">QBitArray</a> & a2 )
|
---|
| 332 | </h3>
|
---|
| 333 |
|
---|
| 334 | <p> Returns the OR result between the bit arrays <em>a1</em> and <em>a2</em>.
|
---|
| 335 | <p> The result has the length of the longest of the two bit arrays,
|
---|
| 336 | with any missing bits (i.e. if one array is shorter than the
|
---|
| 337 | other), taken to be 0.
|
---|
| 338 | <p> <p>See also <a href="#operator|-eq">QBitArray::operator|=</a>().
|
---|
| 339 |
|
---|
| 340 | <!-- eof -->
|
---|
| 341 | <hr><p>
|
---|
| 342 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 343 | Copyright © 1995-2007
|
---|
| 344 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 345 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 346 | <td>Copyright © 2007
|
---|
| 347 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 348 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 349 | </table></div></address></body>
|
---|
| 350 | </html>
|
---|