Qt 4.8
Public Functions | Public Variables | List of all members
HexString< T > Struct Template Reference

#include <qstylehelper_p.h>

Public Functions

 HexString (const T t)
 
void write (QChar *&dest) const
 

Public Variables

const T val
 

Detailed Description

template<typename T>
struct HexString< T >

Definition at line 86 of file qstylehelper_p.h.

Constructors and Destructors

◆ HexString()

template<typename T>
HexString< T >::HexString ( const T  t)
inline

Definition at line 88 of file qstylehelper_p.h.

89  : val(t)
90  {}
const T val

Functions

◆ write()

template<typename T>
void HexString< T >::write ( QChar *&  dest) const
inline

Definition at line 92 of file qstylehelper_p.h.

Referenced by QConcatenable< HexString< T > >::appendTo().

93  {
94  const ushort hexChars[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
95  const char *c = reinterpret_cast<const char *>(&val);
96  for (uint i = 0; i < sizeof(T); ++i) {
97  *dest++ = hexChars[*c & 0xf];
98  *dest++ = hexChars[(*c & 0xf0) >> 4];
99  ++c;
100  }
101  }
unsigned char c[8]
Definition: qnumeric_p.h:62
const T val
unsigned int uint
Definition: qglobal.h:996
unsigned short ushort
Definition: qglobal.h:995

Properties

◆ val

template<typename T>
const T HexString< T >::val

Definition at line 102 of file qstylehelper_p.h.


The documentation for this struct was generated from the following file: