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
|
<?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" />
<!-- qendian.qdoc -->
<title>Qt 4.8: <QtEndian> - Endian Conversion Functions</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 -->
</ul>
</div>
</div>
<div class="content mainContent">
<h1 class="title"><QtEndian> - Endian Conversion Functions</h1>
<span class="subtitle"></span>
<!-- $$$<QtEndian>-brief -->
<p>The <QtEndian> header provides functions to convert between little and big endian representations of numbers. <a href="#details">More...</a></p>
<!-- @@@<QtEndian> -->
<ul>
</ul>
<a name="Functionsx"></a>
<h2>Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtendian.html#qFromBigEndian">qFromBigEndian</a></b> ( const uchar * <i>src</i> )</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtendian.html#qFromBigEndian-2">qFromBigEndian</a></b> ( T <i>src</i> )</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtendian.html#qFromLittleEndian">qFromLittleEndian</a></b> ( const uchar * <i>src</i> )</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtendian.html#qFromLittleEndian-2">qFromLittleEndian</a></b> ( T <i>src</i> )</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtendian.html#qToBigEndian">qToBigEndian</a></b> ( T <i>src</i>, uchar * <i>dest</i> )</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtendian.html#qToBigEndian-2">qToBigEndian</a></b> ( T <i>src</i> )</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qtendian.html#qToLittleEndian">qToLittleEndian</a></b> ( T <i>src</i>, uchar * <i>dest</i> )</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> T </td><td class="memItemRight bottomAlign"><b><a href="qtendian.html#qToLittleEndian-2">qToLittleEndian</a></b> ( T <i>src</i> )</td></tr>
</table>
<!-- $$$<QtEndian>-description -->
<div class="descr"> <a name="details"></a>
</div>
<!-- @@@<QtEndian> -->
<h2>Function Documentation</h2>
<!-- $$$qFromBigEndian[overload1]$$$qFromBigEndianconstuchar* -->
<h3 class="fn"><a name="qFromBigEndian"></a><span class="type">T</span> <span class="name">qFromBigEndian</span> ( const <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> * <i>src</i> )</h3>
<p>Reads a big-endian number from memory location <i>src</i> and returns the number in the host byte order representation. On CPU architectures where the host byte order is little-endian (such as x86) this will swap the byte order; otherwise it will just read from <i>src</i>.</p>
<p><b>Note:</b> Template type <tt>T</tt> can either be a qint16, qint32 or qint64. Other types of integers, e.g., qlong, are not applicable.</p>
<p>There are no data alignment constraints for <i>src</i>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qtendian.html#qFromLittleEndian">qFromLittleEndian</a>(), <a href="qtendian.html#qToBigEndian">qToBigEndian</a>(), and <a href="qtendian.html#qToLittleEndian">qToLittleEndian</a>().</p>
<!-- @@@qFromBigEndian -->
<!-- $$$qFromBigEndian$$$qFromBigEndianT -->
<h3 class="fn"><a name="qFromBigEndian-2"></a><span class="type">T</span> <span class="name">qFromBigEndian</span> ( <span class="type">T</span> <i>src</i> )</h3>
<p>This is an overloaded function.</p>
<p>Converts <i>src</i> from big-endian byte order and returns the number in host byte order representation of that number. On CPU architectures where the host byte order is little-endian (such as x86) this will return <i>src</i> with the byte order swapped; otherwise it will return <i>src</i> unmodified.</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@qFromBigEndian -->
<!-- $$$qFromLittleEndian[overload1]$$$qFromLittleEndianconstuchar* -->
<h3 class="fn"><a name="qFromLittleEndian"></a><span class="type">T</span> <span class="name">qFromLittleEndian</span> ( const <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> * <i>src</i> )</h3>
<p>Reads a little-endian number from memory location <i>src</i> and returns the number in the host byte order representation. On CPU architectures where the host byte order is big-endian (such as PowerPC) this will swap the byte order; otherwise it will just read from <i>src</i>.</p>
<p><b>Note:</b> Template type <tt>T</tt> can either be a qint16, qint32 or qint64. Other types of integers, e.g., qlong, are not applicable.</p>
<p>There are no data alignment constraints for <i>src</i>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qtendian.html#qFromBigEndian">qFromBigEndian</a>(), <a href="qtendian.html#qToBigEndian">qToBigEndian</a>(), and <a href="qtendian.html#qToLittleEndian">qToLittleEndian</a>().</p>
<!-- @@@qFromLittleEndian -->
<!-- $$$qFromLittleEndian$$$qFromLittleEndianT -->
<h3 class="fn"><a name="qFromLittleEndian-2"></a><span class="type">T</span> <span class="name">qFromLittleEndian</span> ( <span class="type">T</span> <i>src</i> )</h3>
<p>This is an overloaded function.</p>
<p>Converts <i>src</i> from little-endian byte order and returns the number in host byte order representation of that number. On CPU architectures where the host byte order is big-endian (such as PowerPC) this will return <i>src</i> with the byte order swapped; otherwise it will return <i>src</i> unmodified.</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@qFromLittleEndian -->
<!-- $$$qToBigEndian[overload1]$$$qToBigEndianTuchar* -->
<h3 class="fn"><a name="qToBigEndian"></a><span class="type">void</span> <span class="name">qToBigEndian</span> ( <span class="type">T</span> <i>src</i>, <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> * <i>dest</i> )</h3>
<p>Writes the number <i>src</i> with template type <tt>T</tt> to the memory location at <i>dest</i> in big-endian byte order.</p>
<p>Note that template type <tt>T</tt> can only be an integer data type (signed or unsigned).</p>
<p>There are no data alignment constraints for <i>dest</i>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qtendian.html#qFromBigEndian">qFromBigEndian</a>(), <a href="qtendian.html#qFromLittleEndian">qFromLittleEndian</a>(), and <a href="qtendian.html#qToLittleEndian">qToLittleEndian</a>().</p>
<!-- @@@qToBigEndian -->
<!-- $$$qToBigEndian$$$qToBigEndianT -->
<h3 class="fn"><a name="qToBigEndian-2"></a><span class="type">T</span> <span class="name">qToBigEndian</span> ( <span class="type">T</span> <i>src</i> )</h3>
<p>This is an overloaded function.</p>
<p>Converts <i>src</i> from host byte order and returns the number in big-endian byte order representation of that number. On CPU architectures where the host byte order is little-endian (such as x86) this will return <i>src</i> with the byte order swapped; otherwise it will return <i>src</i> unmodified.</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@qToBigEndian -->
<!-- $$$qToLittleEndian[overload1]$$$qToLittleEndianTuchar* -->
<h3 class="fn"><a name="qToLittleEndian"></a><span class="type">void</span> <span class="name">qToLittleEndian</span> ( <span class="type">T</span> <i>src</i>, <span class="type"><a href="qtglobal.html#uchar-typedef">uchar</a></span> * <i>dest</i> )</h3>
<p>Writes the number <i>src</i> with template type <tt>T</tt> to the memory location at <i>dest</i> in little-endian byte order.</p>
<p>Note that template type <tt>T</tt> can only be an integer data type (signed or unsigned).</p>
<p>There are no data alignment constraints for <i>dest</i>.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also </b><a href="qtendian.html#qFromBigEndian">qFromBigEndian</a>(), <a href="qtendian.html#qFromLittleEndian">qFromLittleEndian</a>(), and <a href="qtendian.html#qToBigEndian">qToBigEndian</a>().</p>
<!-- @@@qToLittleEndian -->
<!-- $$$qToLittleEndian$$$qToLittleEndianT -->
<h3 class="fn"><a name="qToLittleEndian-2"></a><span class="type">T</span> <span class="name">qToLittleEndian</span> ( <span class="type">T</span> <i>src</i> )</h3>
<p>This is an overloaded function.</p>
<p>Converts <i>src</i> from host byte order and returns the number in little-endian byte order representation of that number. On CPU architectures where the host byte order is big-endian (such as PowerPC) this will return <i>src</i> with the byte order swapped; otherwise it will return <i>src</i> unmodified.</p>
<p>This function was introduced in Qt 4.3.</p>
<!-- @@@qToLittleEndian -->
<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>
|