QBEInteger Class

template <typename T> class QBEInteger

The QBEInteger class provides platform-independent big-endian integers. 更多...

头: #include <QBEInteger>
CMake: find_package(Qt6 COMPONENTS Core REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Since: Qt 5.10

公共函数

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

静态公共成员

QBEInteger<T> max ()
QBEInteger<T> min ()

详细描述

模板参数 T 必须是 C++ 整数类型:

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

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

成员函数文档编制

QBEInteger:: QBEInteger ( T value )

Constructs a QBEInteger with the given value .

[static] QBEInteger < T > QBEInteger:: max ()

Returns the maximum (finite) value representable by the numeric type T.

[static] QBEInteger < T > QBEInteger:: min ()

Returns the minimum (finite) value representable by the numeric type T.

T QBEInteger:: operator T () const

Returns the value of this QBEInteger 作为本机整数。

bool QBEInteger:: operator!= ( QBEInteger < T > other ) const

返回 true if the value of this QBEInteger is not equal to the value of other .

QBEInteger < T > &QBEInteger:: operator%= ( T i )

设置此 QBEInteger to the remainder of a division by i and returns a reference to this object.

QBEInteger < T > &QBEInteger:: operator&= ( T i )

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

QBEInteger < T > &QBEInteger:: operator*= ( T i )

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

QBEInteger < T > &QBEInteger:: operator++ ()

Performs a prefix ++ (increment) on this QBEInteger and returns a reference to this object.

QBEInteger < T > &QBEInteger:: operator++ ( int )

Performs a postfix ++ (increment) on this QBEInteger and returns a reference to this object.

QBEInteger < T > &QBEInteger:: operator+= ( T i )

添加 i 到此 QBEInteger and returns a reference to this object.

QBEInteger < T > &QBEInteger:: operator-- ()

Performs a prefix -- (decrement) on this QBEInteger and returns a reference to this object.

QBEInteger < T > &QBEInteger:: operator-- ( int )

Performs a postfix -- (decrement) on this QBEInteger and returns a reference to this object.

QBEInteger < T > &QBEInteger:: operator-= ( T i )

减去 i 从此 QBEInteger and returns a reference to this object.

QBEInteger < T > &QBEInteger:: operator/= ( T i )

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

QBEInteger < T > &QBEInteger:: operator<<= ( T i )

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

QBEInteger < T > &QBEInteger:: operator= ( T i )

赋值 i 到此 QBEInteger and returns a reference to this QBEInteger .

bool QBEInteger:: operator== ( QBEInteger < T > other ) const

返回 true if the value of this QBEInteger is equal to the value of other .

QBEInteger < T > &QBEInteger:: operator>>= ( T i )

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

QBEInteger < T > &QBEInteger:: operator^= ( T i )

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

QBEInteger < T > &QBEInteger:: operator|= ( T i )

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