<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qendian.cpp --> <title>QBEInteger Class | Qt Core 5.12.6</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.12</td><td ><a href="qtcore-index.html">Qt Core</a></td><td ><a href="qtcore-module.html">C++ Classes</a></td><td >QBEInteger</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right"><a href="qtcore-index.html">Qt 5.12.6 Reference Documentation</a></td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <div class="sidebar"> <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="#static-public-members">Static Public Members</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">QBEInteger Class</h1> <!-- $$$QBEInteger-brief --> <p>The <a href="qbeinteger.html">QBEInteger</a> class provides platform-independent big-endian integers. <a href="#details">More...</a></p> <!-- @@@QBEInteger --> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <span class="preprocessor">#include <QBEInteger></span> </td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += core</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.10</td></tr></table></div><ul> <li><a href="qbeinteger-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h2 id="public-functions">Public Functions</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#QBEInteger">QBEInteger</a></b>(T <i>value</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-T">operator T</a></b>() const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-not-eq">operator!=</a></b>(QBEInteger<T> <i>other</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-25-eq">operator%=</a></b>(T <i>i</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-and-eq">operator&=</a></b>(T <i>i</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-2a-eq">operator*=</a></b>(T <i>i</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-2b-2b">operator++</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-2b-2b-1">operator++</a></b>(<i>int</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-2b-eq">operator+=</a></b>(T <i>i</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator--">operator--</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator---1">operator--</a></b>(<i>int</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator--eq">operator-=</a></b>(T <i>i</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-2f-eq">operator/=</a></b>(T <i>i</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-lt-lt-eq">operator<<=</a></b>(T <i>i</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-eq">operator=</a></b>(T <i>i</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-eq-eq">operator==</a></b>(QBEInteger<T> <i>other</i>) const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-gt-gt-eq">operator>>=</a></b>(T <i>i</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-5e-eq">operator^=</a></b>(T <i>i</i>)</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> &</td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#operator-7c-eq">operator|=</a></b>(T <i>i</i>)</td></tr> </table></div> <a name="static-public-members"></a> <h2 id="static-public-members">Static Public Members</h2> <div class="table"><table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> </td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#max">max</a></b>()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QBEInteger<T> </td><td class="memItemRight bottomAlign"><b><a href="qbeinteger.html#min">min</a></b>()</td></tr> </table></div> <a name="details"></a> <!-- $$$QBEInteger-description --> <div class="descr"> <h2 id="details">Detailed Description</h2> <p>The <a href="qbeinteger.html">QBEInteger</a> class provides platform-independent big-endian integers.</p> <p>The template parameter <code>T</code> must be a C++ integer type:</p> <ul> <li>8-bit: char, signed char, unsigned char, qint8, quint8</li> <li>16-bit: short, unsigned short, qint16, quint16, char16_t (C++11)</li> <li>32-bit: int, unsigned int, qint32, quint32, char32_t (C++11)</li> <li>64-bit: long long, unsigned long long, qint64, quint64</li> <li>platform-specific size: long, unsigned long</li> <li>pointer size: qintptr, quintptr, qptrdiff</li> </ul> <p><b>Note: </b>Using this class may be slower than using native integers, so only use it when an exact endianness is needed.</p></div> <!-- @@@QBEInteger --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QBEInteger[overload1]$$$QBEIntegerT --> <h3 class="fn" id="QBEInteger"><a name="QBEInteger"></a>QBEInteger::<span class="name">QBEInteger</span>(<span class="type">T</span> <i>value</i>)</h3> <p>Constructs a <a href="qbeinteger.html">QBEInteger</a> with the given <i>value</i>.</p> <!-- @@@QBEInteger --> <!-- $$$max[overload1]$$$max --> <h3 class="fn" id="max"><a name="max"></a><code>[static] </code><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> QBEInteger::<span class="name">max</span>()</h3> <p>Returns the maximum (finite) value representable by the numeric type T.</p> <!-- @@@max --> <!-- $$$min[overload1]$$$min --> <h3 class="fn" id="min"><a name="min"></a><code>[static] </code><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> QBEInteger::<span class="name">min</span>()</h3> <p>Returns the minimum (finite) value representable by the numeric type T.</p> <!-- @@@min --> <!-- $$$operator T[overload1]$$$operator T --> <h3 class="fn" id="operator-T"><a name="operator-T"></a><span class="type">T</span> QBEInteger::<span class="name">operator T</span>() const</h3> <p>Returns the value of this <a href="qbeinteger.html">QBEInteger</a> as a native integer.</p> <!-- @@@operator T --> <!-- $$$operator!=[overload1]$$$operator!=QBEInteger<T> --> <h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QBEInteger::<span class="name">operator!=</span>(<span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> <i>other</i>) const</h3> <p>Returns <code>true</code> if the value of this <a href="qbeinteger.html">QBEInteger</a> is not equal to the value of <i>other</i>.</p> <!-- @@@operator!= --> <!-- $$$operator%=[overload1]$$$operator%=T --> <h3 class="fn" id="operator-25-eq"><a name="operator-25-eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator%=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Sets this <a href="qbeinteger.html">QBEInteger</a> to the remainder of a division by <i>i</i> and returns a reference to this object.</p> <!-- @@@operator%= --> <!-- $$$operator&=[overload1]$$$operator&=T --> <h3 class="fn" id="operator-and-eq"><a name="operator-and-eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator&=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Performs a bitwise AND with <i>i</i> onto this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator&= --> <!-- $$$operator*=[overload1]$$$operator*=T --> <h3 class="fn" id="operator-2a-eq"><a name="operator-2a-eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator*=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Multiplies <i>i</i> with this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator*= --> <!-- $$$operator++[overload1]$$$operator++ --> <h3 class="fn" id="operator-2b-2b"><a name="operator-2b-2b"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator++</span>()</h3> <p>Performs a prefix ++ (increment) on this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator++ --> <!-- $$$operator++$$$operator++int --> <h3 class="fn" id="operator-2b-2b-1"><a name="operator-2b-2b-1"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator++</span>(<i>int</i>)</h3> <p>Performs a postfix ++ (increment) on this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator++ --> <!-- $$$operator+=[overload1]$$$operator+=T --> <h3 class="fn" id="operator-2b-eq"><a name="operator-2b-eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator+=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Adds <i>i</i> to this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator+= --> <!-- $$$operator--[overload1]$$$operator-- --> <h3 class="fn" id="operator--"><a name="operator--"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator--</span>()</h3> <p>Performs a prefix -- (decrement) on this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator-- --> <!-- $$$operator--$$$operator--int --> <h3 class="fn" id="operator---1"><a name="operator---1"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator--</span>(<i>int</i>)</h3> <p>Performs a postfix -- (decrement) on this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator-- --> <!-- $$$operator-=[overload1]$$$operator-=T --> <h3 class="fn" id="operator--eq"><a name="operator--eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator-=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Subtracts <i>i</i> from this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator-= --> <!-- $$$operator/=[overload1]$$$operator/=T --> <h3 class="fn" id="operator-2f-eq"><a name="operator-2f-eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator/=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Divides this <a href="qbeinteger.html">QBEInteger</a> with <i>i</i> and returns a reference to this object.</p> <!-- @@@operator/= --> <!-- $$$operator<<=[overload1]$$$operator<<=T --> <h3 class="fn" id="operator-lt-lt-eq"><a name="operator-lt-lt-eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator<<=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Performs a right-shift by <i>i</i> on this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator<<= --> <!-- $$$operator=[overload1]$$$operator=T --> <h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Assigns <i>i</i> to this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this <a href="qbeinteger.html">QBEInteger</a>.</p> <!-- @@@operator= --> <!-- $$$operator==[overload1]$$$operator==QBEInteger<T> --> <h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QBEInteger::<span class="name">operator==</span>(<span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> <i>other</i>) const</h3> <p>Returns <code>true</code> if the value of this <a href="qbeinteger.html">QBEInteger</a> is equal to the value of <i>other</i>.</p> <!-- @@@operator== --> <!-- $$$operator>>=[overload1]$$$operator>>=T --> <h3 class="fn" id="operator-gt-gt-eq"><a name="operator-gt-gt-eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator>>=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Performs a left-shift by <i>i</i> on this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator>>= --> <!-- $$$operator^=[overload1]$$$operator^=T --> <h3 class="fn" id="operator-5e-eq"><a name="operator-5e-eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator^=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Performs a bitwise XOR with <i>i</i> onto this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator^= --> <!-- $$$operator|=[overload1]$$$operator|=T --> <h3 class="fn" id="operator-7c-eq"><a name="operator-7c-eq"></a><span class="type"><a href="qbeinteger.html#QBEInteger">QBEInteger</a></span><<span class="type">T</span>> &QBEInteger::<span class="name">operator|=</span>(<span class="type">T</span> <i>i</i>)</h3> <p>Performs a bitwise OR with <i>i</i> onto this <a href="qbeinteger.html">QBEInteger</a> and returns a reference to this object.</p> <!-- @@@operator|= --> </div> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2019 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br/> 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.<br/> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>