<QtEndian> 頭提供在數字的小端、大端錶示之間轉換的函數。 更多...
| typedef | qint16_be |
| typedef | qint16_le |
| typedef | qint32_be |
| typedef | qint32_le |
| typedef | qint64_be |
| typedef | qint64_le |
| typedef | quint16_be |
| typedef | quint16_le |
| typedef | quint32_be |
| typedef | quint32_le |
| typedef | quint64_be |
| typedef | quint64_le |
| T | qFromBigEndian (T src ) |
| T | qFromBigEndian (const void * src ) |
| void | qFromBigEndian (const void * src , qsizetype count , void * dest ) |
| T | qFromLittleEndian (T src ) |
| T | qFromLittleEndian (const void * src ) |
| void | qFromLittleEndian (const void * src , qsizetype count , void * dest ) |
| T | qToBigEndian (T src ) |
| void | qToBigEndian (T src , void * dest ) |
| void | qToBigEndian (const void * src , qsizetype count , void * dest ) |
| T | qToLittleEndian (T src ) |
| void | qToLittleEndian (T src , void * dest ) |
| void | qToLittleEndian (const void * src , qsizetype count , void * dest ) |
typedef 對於 QBEInteger <qint16>。在所有 Qt 支持平颱,保證將此類型按 16 位大端在前有符號整數存儲在內存中。
該 typedef 在 Qt 5.10 引入。
另請參閱 qint16 .
typedef 對於 QLEInteger <qint16>. This type is guaranteed to be stored in memory as a 16-bit little-endian signed integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 qint16 .
typedef 對於 QBEInteger <qint32>. This type is guaranteed to be stored in memory as a 32-bit big-endian signed integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 qint32 .
typedef 對於 QLEInteger <qint32>. This type is guaranteed to be stored in memory as a 32-bit little-endian signed integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 qint32 .
typedef 對於 QBEInteger <qint64>. This type is guaranteed to be stored in memory as a 64-bit big-endian signed integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 qint64 .
typedef 對於 QLEInteger <qint64>. This type is guaranteed to be stored in memory as a 64-bit little-endian signed integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 qint64 .
typedef 對於 QBEInteger <quint16>. This type is guaranteed to be stored in memory as a 16-bit big-endian unsigned integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 quint16 .
typedef 對於 QLEInteger <quint16>. This type is guaranteed to be stored in memory as a 16-bit little-endian unsigned integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 quint16 .
typedef 對於 QBEInteger <quint32>. This type is guaranteed to be stored in memory as a 32-bit big-endian unsigned integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 quint32 .
typedef 對於 QLEInteger <quint32>. This type is guaranteed to be stored in memory as a 32-bit little-endian unsigned integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 quint32 .
typedef 對於 QBEInteger <quint64>. This type is guaranteed to be stored in memory as a 64-bit big-endian unsigned integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 quint64 .
typedef 對於 QLEInteger <quint64>. This type is guaranteed to be stored in memory as a 64-bit little-endian unsigned integer on all platforms supported by Qt.
該 typedef 在 Qt 5.10 引入。
另請參閱 quint64 .
這是重載函數。
轉換 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 未經修改。
該函數在 Qt 4.3 引入。
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 .
注意:
模闆類型
T
can either be a quint16, qint16, quint32, qint32, quint64, or qint64. Other types of integers, e.g., qlong, are not applicable.
注意: 從 Qt 5.7 起,類型的 src 參數是 void 指針。
沒有數據對齊約束對於 src .
該函數在 Qt 4.3 引入。
另請參閱 qFromLittleEndian (), qToBigEndian (),和 qToLittleEndian ().
讀取
count
big-endian numbers from memory location
src
and stores them in the host byte order representation at
dest
. On CPU architectures where the host byte order is little-endian (such as x86) this will swap the byte order; otherwise it will just perform a
memcpy
from
src
to
dest
.
注意:
模闆類型
T
can either be a quint16, qint16, quint32, qint32, quint64, or qint64. Other types of integers, e.g., qlong, are not applicable.
沒有數據對齊約束對於
src
。不管怎樣,
dest
is expected to be naturally aligned for type
T
.
若 src and dest can be the same pointer, this function will perform an in-place swap (if necessary). If they are not the same, the memory regions must not overlap.
該函數在 Qt 5.12 引入。
另請參閱 qFromLittleEndian (), qToBigEndian (),和 qToLittleEndian ().
這是重載函數。
轉換 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 未經修改。
該函數在 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 .
注意:
模闆類型
T
can either be a quint16, qint16, quint32, qint32, quint64, or qint64. Other types of integers, e.g., qlong, are not applicable.
注意: 從 Qt 5.7 起,類型的 src 參數是 void 指針。
沒有數據對齊約束對於 src .
該函數在 Qt 4.3 引入。
另請參閱 qFromBigEndian (), qToBigEndian (),和 qToLittleEndian ().
讀取
count
little-endian numbers from memory location
src
and stores them in the host byte order representation at
dest
. On CPU architectures where the host byte order is big-endian (such as PowerPC) this will swap the byte order; otherwise it will just perform a
memcpy
from
src
to
dest
.
注意:
模闆類型
T
can either be a quint16, qint16, quint32, qint32, quint64, or qint64. Other types of integers, e.g., qlong, are not applicable.
沒有數據對齊約束對於
src
。不管怎樣,
dest
is expected to be naturally aligned for type
T
.
若 src and dest can be the same pointer, this function will perform an in-place swap (if necessary). If they are not the same, the memory regions must not overlap.
該函數在 Qt 5.12 引入。
另請參閱 qFromLittleEndian (), qToBigEndian (),和 qToLittleEndian ().
這是重載函數。
轉換 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 未經修改。
該函數在 Qt 4.3 引入。
Writes the number
src
with template type
T
to the memory location at
dest
in big-endian byte order.
注意:
模闆類型
T
can either be a quint16, qint16, quint32, qint32, quint64, or qint64. Other types of integers, e.g., qlong, are not applicable.
沒有數據對齊約束對於 dest .
注意: 從 Qt 5.7 起,類型的 dest 參數是 void 指針。
該函數在 Qt 4.3 引入。
另請參閱 qFromBigEndian (), qFromLittleEndian (),和 qToLittleEndian ().
讀取
count
numbers from memory location
src
in the host byte order and stores them in big-endian representation at
dest
. On CPU architectures where the host byte order is little-endian (such as x86) this will swap the byte order; otherwise it will just perform a
memcpy
from
src
to
dest
.
注意:
模闆類型
T
can either be a quint16, qint16, quint32, qint32, quint64, or qint64. Other types of integers, e.g., qlong, are not applicable.
沒有數據對齊約束對於
dest
。不管怎樣,
src
is expected to be naturally aligned for type
T
.
若 src and dest can be the same pointer, this function will perform an in-place swap (if necessary). If they are not the same, the memory regions must not overlap.
該函數在 Qt 5.12 引入。
另請參閱 qFromLittleEndian (), qToBigEndian (),和 qToLittleEndian ().
這是重載函數。
轉換 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 未經修改。
該函數在 Qt 4.3 引入。
Writes the number
src
with template type
T
to the memory location at
dest
in little-endian byte order.
注意:
模闆類型
T
can either be a quint16, qint16, quint32, qint32, quint64, or qint64. Other types of integers, e.g., qlong, are not applicable.
沒有數據對齊約束對於 dest .
注意: 從 Qt 5.7 起,類型的 dest 參數是 void 指針。
該函數在 Qt 4.3 引入。
另請參閱 qFromBigEndian (), qFromLittleEndian (),和 qToBigEndian ().
讀取
count
numbers from memory location
src
in the host byte order and stores them in little-endian representation at
dest
. On CPU architectures where the host byte order is big-endian (such as PowerPC) this will swap the byte order; otherwise it will just perform a
memcpy
from
src
to
dest
.
注意:
模闆類型
T
can either be a quint16, qint16, quint32, qint32, quint64, or qint64. Other types of integers, e.g., qlong, are not applicable.
沒有數據對齊約束對於
dest
。不管怎樣,
src
is expected to be naturally aligned for type
T
.
若 src and dest can be the same pointer, this function will perform an in-place swap (if necessary). If they are not the same, the memory regions must not overlap.
該函數在 Qt 5.12 引入。
另請參閱 qFromLittleEndian (), qToBigEndian (),和 qToLittleEndian ().