QLEInteger Class

The QLEInteger class provides platform-independent little-endian integers. More...

Header: #include <QLEInteger>
qmake: QT += core
Since: Qt 5.10

Public Functions

QLEInteger(T value)
operator T() const
bool operator!=(QLEInteger other) const
QLEInteger &operator%=(T i)
QLEInteger &operator&=(T i)
QLEInteger &operator*=(T i)
QLEInteger &operator+=(T i)
QLEInteger &operator-=(T i)
QLEInteger &operator/=(T i)
QLEInteger &operator<<=(T i)
QLEInteger &operator=(T value)
bool operator==(QLEInteger other) const
QLEInteger &operator>>=(T i)
QLEInteger &operator^=(T i)
QLEInteger &operator|=(T i)

Detailed Description

The QLEInteger class provides platform-independent little-endian integers.

The template parameter T must be a C++ integer type:

  • 8-bit: char, signed char, unsigned char, qint8, quint8
  • 16-bit: short, unsigned short, qint16, quint16, char16_t
  • 32-bit: int, unsigned int, qint32, quint32, char32_t
  • 64-bit: long long, unsigned long long, qint64, quint64
  • platform-specific size: long, unsigned long
  • pointer size: qintptr, quintptr, qptrdiff

Note: Using this class may be slower than using native integers, so only use it when an exact endian is needed.

Member Function Documentation

QLEInteger::QLEInteger(T value)

Constructs a QLEInteger with the given value.

QLEInteger::operator T() const

Returns the value of this QLEInteger as a native integer.

bool QLEInteger::operator!=(QLEInteger other) const

Returns true if the value of this QLEInteger is not equal to the value of other.

QLEInteger &QLEInteger::operator%=(T i)

Sets this QLEInteger to the remainder of a division by i and returns a reference to this object.

QLEInteger &QLEInteger::operator&=(T i)

Performs a bitwise AND with i onto this QLEInteger and returns a reference to this object.

QLEInteger &QLEInteger::operator*=(T i)

Multiplies i with this QLEInteger and returns a reference to this object.

QLEInteger &QLEInteger::operator+=(T i)

Adds i to this QLEInteger and returns a reference to this object.

QLEInteger &QLEInteger::operator-=(T i)

Subtracts i from this QLEInteger and returns a reference to this object.

QLEInteger &QLEInteger::operator/=(T i)

Divides this QLEInteger with i and returns a reference to this object.

QLEInteger &QLEInteger::operator<<=(T i)

Performs a right-shift by i on this QLEInteger and returns a reference to this object.

QLEInteger &QLEInteger::operator=(T value)

Assigns value to this QLEInteger and returns a reference to this QLEInteger.

bool QLEInteger::operator==(QLEInteger other) const

Returns true if the value of this QLEInteger is equal to the value of other.

QLEInteger &QLEInteger::operator>>=(T i)

Performs a left-shift by i on this QLEInteger and returns a reference to this object.

QLEInteger &QLEInteger::operator^=(T i)

Performs a bitwise XOR with i onto this QLEInteger and returns a reference to this object.

QLEInteger &QLEInteger::operator|=(T i)

Performs a bitwise OR with i onto this QLEInteger and returns a reference to this object.