Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

<QtEndian> - Endian Conversion Functions

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.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 41
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 6
Page suivante

Le Qt Labs au hasard

Logo

Améliorer les performances de Qt lors du rendu avec plus de SIMD

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.6
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web