The <QtEndian> header provides functions to convert between little and big endian representations of numbers. More...

Functions

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)
Function Documentation

T qFromBigEndian(const uchar * 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().

T qFromBigEndian(T src)
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.

T qFromLittleEndian(const uchar * src)
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().

T qFromLittleEndian(T src)
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.

void qToBigEndian(T src, uchar * dest)
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().

T qToBigEndian(T src)
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.

void qToLittleEndian(T src, uchar * dest)
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().

T qToLittleEndian(T src)
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.

<QtEndian> - Endian Conversion Functions的更多相关文章

  1. Endian

    Endian 寻址 多字节对象被存储为连续的字节序列,对象的地址为所使用字节中最小的地址. 例如,假设一个类型为 int 的变量 a 的地址为 0x100,也就是说,地址表达式 &a 的值为 ...

  2. SQL Fundamentals || Single-Row Functions || 转换函数 Conversion function

    SQL Fundamentals || Oracle SQL语言   SQL Fundamentals: Using Single-Row Functions to Customize Output使 ...

  3. Think Python - Chapter 16 - Classes and functions

    16.1 TimeAs another example of a user-defined type, we’ll define a class called Time that records th ...

  4. Think Python - Chapter 03 - Functions

    3.1 Function callsIn the context of programming, a function is a named sequence of statements that p ...

  5. [HIve - LanguageManual] Hive Operators and User-Defined Functions (UDFs)

    Hive Operators and User-Defined Functions (UDFs) Hive Operators and User-Defined Functions (UDFs) Bu ...

  6. [Hive - Tutorial] Built In Operators and Functions 内置操作符与内置函数

    Built-in Operators Relational Operators The following operators compare the passed operands and gene ...

  7. C-Language Functions

    转自:https://www.postgresql.org/docs/9.6/xfunc-c.html 可以作为学习基于c编写pg extension 的资料 36.9. C-Language Fun ...

  8. SQL Fundamentals || Single-Row Functions || 字符函数 character functions

    SQL Fundamentals || Oracle SQL语言   SQL Fundamentals: Using Single-Row Functions to Customize Output使 ...

  9. SQL Fundamentals: Using Single-Row Functions to Customize Output使用单行函数自定义输出

    SQL Fundamentals || Oracle SQL语言 DUAL is a public table that you can use to view results from functi ...

随机推荐

  1. [转]天龙八部的BillingServer

    从字面上看,Billing是计费的,应该处理玩家在线时间或者包月之类.但是天龙八部是免费游戏,不需要算时间来计费.从代码中看,BillingServer也比较简单,它有一个连接到Web服务器,并监听一 ...

  2. 《学习OpenCV》练习题第四章第七题abc

    题外话:一直是打算把这本书的全部课后编程题写完的,中间断了几个月,一直忙于其他事.现在开始补上. 这道题我不清楚我理解的题意是不是正确的,这道题可以练习用OpenCV实现透视变换(可以用于矫正在3维环 ...

  3. air 移动开发配置文件详解

    转自http://www.badyoo.com/index.php/2012/09/12/208/index.html 目录 所需的 AIR 运行时版本 应用程序标识 应用程序版本 主应用程序 SWF ...

  4. 轻松学习Linux之理解进程的管理与控制

    本文出自 "李晨光原创技术博客" 博客,谢绝转载!

  5. Kali Linux 安装教程-转

    rootoorotor昨天折腾了 Kali Linux 1.0,把大概的配置过程记录下来,希望对想接触或使用Kali Linux的同学有所帮助.   请注意: 1.本文为面向新手的教程,没技术含量,没 ...

  6. 转】MySQL客户端输出窗口显示中文乱码问题解决办法

    原博文出自于: http://www.cnblogs.com/xdp-gacl/p/4008095.html 感谢! 最近发现,在MySQL的dos客户端输出窗口中查询表中的数据时,表中的中文数据都显 ...

  7. 有关require package的应用

    http://stackoverflow.com/questions/9302284/relative-paths-with-requirejs-modules-packages http://sta ...

  8. HDU 2042 不容易系列之二 [补6.24] 分类: ACM 2015-06-26 20:40 9人阅读 评论(0) 收藏

    不容易系列之二 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Su ...

  9. ODBC 是什么

    In computing, ODBC (Open Database Connectivity) is a standard programming language middleware API fo ...

  10. IIS7 “拒绝访问临时目录”

    创建 BlogConfigurationSettings 的配置节处理程序时出错: 拒绝访问临时目录.以其运行 XmlSerializer 的身份“IIS APPPOOL\5656qp.com.rmi ...