5#include "qx/core/qx_core_export.h"
30 primitive = qToLittleEndian(primitive);
32 primitive = qToBigEndian(primitive);
35 return QByteArray(
reinterpret_cast<const char*
>(&primitive),
sizeof(T));
44#if defined __GNUC__ && !defined __clang__
62 if(ba.
size() <
sizeof(T))
64 return qFromLittleEndian<T>(ba);
68 if(ba.
size() <
sizeof(T))
70 return qFromBigEndian<T>(ba);
The ByteArray class is a collection of static functions pertaining to QByteArray.
Definition qx-bytearray.h:21
static QByteArray fromPrimitive(T primitive, QSysInfo::Endian endianness=QSysInfo::ByteOrder)
Definition qx-bytearray.h:26
static T toPrimitive(QByteArray ba, QSysInfo::Endian endianness=QSysInfo::ByteOrder)
Definition qx-bytearray.h:58
Specifies that a type is an arithmetic type.
Definition qx-concepts.h:497
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5
QByteArray & append(QByteArrayView data)
QByteArray & prepend(QByteArrayView ba)
qsizetype size() const const
The qx-concepts header file provides a library of general purpose concepts as an extension of the sta...