6.0.0-rc4Source

QBEInteger Class

template <typename T> class QBEInteger

The QBEInteger class provides an integer that is stored in big-endian byte order. More…

Header#include <QBEInteger>
CMaketarget_link_libraries(app PRIVATE Nt::Core)
ModuleNt Core C++ Classes
InheritsQtPrivate::SpecialInteger

List of all members, including inherited members

Public Functions

QBEInteger()
QBEInteger(T value)
QBEInteger &operator=(T value)

Detailed Description

The object has the size of T and holds the bytes in network order, whatever the byte order of the host, so it can be overlaid on a binary format. It converts to and from T implicitly, and supports the compound assignment and increment operators:

struct Header {
    quint16_be length;
    quint32_be id;
};
Header h;
h.length = 1500;
quint16 n = h.length;

T is an integer type.

See also QLEInteger.

Member Function Documentation

QBEInteger::QBEInteger()

Constructs an uninitialized integer.

QBEInteger::QBEInteger(T value)

Constructs an integer holding value.

QBEInteger & QBEInteger::operator=(T value)

Assigns value and returns this object.