The <QtEndian> header provides functions to convert between little and big endian representations of numbers. More...
T | qFromBigEndian ( const uchar * src ) |
T | qFromBigEndian ( T src ) |
T | qFromLittleEndian ( const uchar * src ) |
T | qFromLittleEndian ( T src ) |
void | qToBigEndian ( T src, uchar * dest ) |
T | qToBigEndian ( T src ) |
void | qToLittleEndian ( T src, uchar * dest ) |
T | qToLittleEndian ( T src ) |
Reads a big-endian number from memory location src 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 src.
Note: Template type T can either be a qint16, qint32 or qint64. Other types of integers, e.g., qlong, are not applicable.
There are no data alignment constraints for src.
This function was introduced in Qt 4.3.
See also qFromLittleEndian(), qToBigEndian(), and qToLittleEndian().
This is an overloaded function.
Converts src 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 src with the byte order swapped; otherwise it will return src unmodified.
This function was introduced in Qt 4.3.
Reads a little-endian number from memory location src 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 src.
Note: Template type T can either be a qint16, qint32 or qint64. Other types of integers, e.g., qlong, are not applicable.
There are no data alignment constraints for src.
This function was introduced in Qt 4.3.
See also qFromBigEndian(), qToBigEndian(), and qToLittleEndian().
This is an overloaded function.
Converts src 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 src with the byte order swapped; otherwise it will return src unmodified.
This function was introduced in Qt 4.3.
Writes the number src with template type T to the memory location at dest in big-endian byte order.
Note that template type T can only be an integer data type (signed or unsigned).
There are no data alignment constraints for dest.
This function was introduced in Qt 4.3.
See also qFromBigEndian(), qFromLittleEndian(), and qToLittleEndian().
This is an overloaded function.
Converts src 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 src with the byte order swapped; otherwise it will return src unmodified.
This function was introduced in Qt 4.3.
Writes the number src with template type T to the memory location at dest in little-endian byte order.
Note that template type T can only be an integer data type (signed or unsigned).
There are no data alignment constraints for dest.
This function was introduced in Qt 4.3.
See also qFromBigEndian(), qFromLittleEndian(), and qToBigEndian().
This is an overloaded function.
Converts src 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 src with the byte order swapped; otherwise it will return src unmodified.
This function was introduced in Qt 4.3.
© 2008-2011 Nokia Corporation and/or its subsidiaries. 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. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.