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. CUDA ---- Hello World From GPU

    本篇博文仅实现hello world,先看到效果,具体细节将在后续博文解释. 准备 如果你是第一次使用CUDA,在Linux下可以使用下面的命令来检查CUDA编译器是否安装正确: $ which nv ...

  2. js获取时间搓

    var oData=new Date().getTime(2016-01-16); console.log(oData);

  3. 第二百一十三天 how can I 坚持

    今天去爬山了,百望山,山好矮,绕来绕去也挺远的,山上有座庙,佘太君庙,还有个望京楼,还看到了个写书法的,不懂,但很崇拜. 今天玩LOL全输了,咋搞的呢. 还有买了点排骨,都没吃完. 下周去爬凤凰岭. ...

  4. CSRF的攻击与防御(转)

    add by zhj:CSRF之所有发生,是因为http请求中会自动带上cookies,我的解决办法是:前端不要将数据放在cookie中,而是放在其它本地存储 (HTML5中称之为Web Storag ...

  5. Primitive Objects

    [Primitive Objects] Unity can work with 3D models of any shape that can be created with modelling so ...

  6. HDU 4610 Cards (合数分解,枚举)

    Cards Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submi ...

  7. LeetCode283:Move Zeros

    Given an array nums, write a function to move all 0's to the end of it while maintaining the relativ ...

  8. all & any

    def all(*args, **kwargs): """ Return True if bool(x) is True for all values x in the ...

  9. IOS学习之路十二(UITableView下拉刷新页面)

    今天做了一个下拉刷新的demo,主要用到了实现的开源框架是:https://github.com/enormego/EGOTableViewPullRefresh 运行结果如下: 实现很简单下载源代码 ...

  10. jpa 支持(sql)JDBC标准语句

    =====================dao================================ package com.jb.xs.Dao.impl; import java.uti ...