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. mysql 用户权限

    创建用户 CREATE USER username IDENTIFIED BY 'password';

  2. 未能加载文件或程序集“Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。

    未能加载文件或程序集“Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed”或它的某一个 ...

  3. always NetWork Performance measure Tools

    1,iperf key feature:Measuring TCP and UDP BandWidth Performance Iperf features; *TCP .Measure bandwi ...

  4. Hadoop构成

    What Is Apache Hadoop? The Apache™ Hadoop® project develops open-source software for reliable, scala ...

  5. 第三百四十九、五十天 how can I 坚持

    昨天是忘写博客了,今天下班才突然意思到,搞框架搞了好晚.今天重新下了个好了. 昨天,把存储过程交给同事写了,啥都不会,又一堆问题,折腾了一天. 今天相对轻松些,不过事情还没完..明天又周五了. 还有昨 ...

  6. AWstat(linux下)

    一.AWstat统计信息 AWstat是一个非常简洁而且功能强大的统计工具.它可以统计你站点的如下信息: 1 访问量.访问次数.页面浏览量.点击数.数据流量等精确到每月.每日.每小时 2 访问者国家. ...

  7. D. Green and Black Tea

    先搞多的,搞到相等. (tmd上星期+上上星期简直是弱智,怎么也不会写,总是想着各种a/b,,,踢蹬) #include<bits/stdc++.h> #define lowbit(x) ...

  8. 4.接口隔离原则(Interface Segregation Principle)

    1.定义 客户端不应该依赖它不需要的接口: 一个类对另一个类的依赖应该建立在最小的接口上. 2.定义解读 定义包含三层含义: 一个类对另一个类的依赖应该建立在最小的接口上: 一个接口代表一个角色,不应 ...

  9. 利用Notepad++插件(JSToolNpp):让JS代码格式化对齐

    http://www.ycyjkj.com/post-663.html 程序员或者正在学习的同学一般都会遇到一个问题,看别人的源码,只是一行,没有分开,让人看的很别扭,也可能是作者故意这样做的,也可以 ...

  10. HTML5 Web Speech API 结合Ext实现浏览器语音识别以及输入

    简介      Web Speech API是HTML5技术中的一个提供原生语音识别技术的API,Google Chrome在25版之后开始支持Web Speech API,Google也提供了一个 ...