44 #include <QtCore/qfloat16.h>
45 #include <QtCore/qglobal.h>
70 const size_t size =
sizeof(
T);
71 #if __has_builtin(__builtin_memcpy)
82 const size_t size =
sizeof(
T);
83 #if __has_builtin(__builtin_memcpy)
110 | ((
source & 0x000000ff) << 24)
111 | ((
source & 0x0000ff00) << 8)
112 | ((
source & 0x00ff0000) >> 8)
113 | ((
source & 0xff000000) >> 24);
119 | ((
source & 0x00ff) << 8)
120 | ((
source & 0xff00) >> 8) );
134 template <
typename T,
typename = std::enable_if_t<std::is_
integral_v<T>>>
141 template<
typename Float>
145 auto temp = qFromUnaligned<typename QIntegerForSizeof<Float>::Unsigned>(&
source);
147 return qFromUnaligned<Float>(&temp);
171 template <
typename T>
inline void qbswap(
const T src,
void *dest)
185 #if Q_BYTE_ORDER == Q_BIG_ENDIAN
196 { qToUnaligned<T>(
src, dest); }
198 { qbswap<T>(
src, dest); }
219 { qbswap<T>(
src, dest); }
221 { qToUnaligned<T>(
src, dest); }
245 {
return static_cast<const quint8 *
>(
src)[0]; }
247 {
return static_cast<const qint8 *
>(
src)[0]; }
259 {
return static_cast<const quint8 *
>(
src)[0]; }
261 {
return static_cast<const qint8 *
>(
src)[0]; }
266 typedef typename S::StorageType
T;
273 operator T()
const {
return S::fromSpecial(
val); }
279 {
return (*
this = S::fromSpecial(
val) +
i); }
281 {
return (*
this = S::fromSpecial(
val) -
i); }
283 {
return (*
this = S::fromSpecial(
val) *
i); }
285 {
return (*
this = S::fromSpecial(
val) >>
i); }
287 {
return (*
this = S::fromSpecial(
val) <<
i); }
289 {
return (*
this = S::fromSpecial(
val) /
i); }
291 {
return (*
this = S::fromSpecial(
val) %
i); }
293 {
return (*
this = S::fromSpecial(
val) |
i); }
295 {
return (*
this = S::fromSpecial(
val) &
i); }
297 {
return (*
this = S::fromSpecial(
val) ^
i); }
299 {
return (*
this = S::fromSpecial(
val) + 1); }
301 {
return (*
this = S::fromSpecial(
val) - 1); }
399 template <
typename T>
403 template <
typename T>
small capitals from c petite p scientific i
[1]
The QBEInteger class provides platform-independent big-endian integers.
static constexpr T fromSpecial(T source)
static constexpr T toSpecial(T source)
The QLEInteger class provides platform-independent little-endian integers.
static constexpr T fromSpecial(T source)
static constexpr T toSpecial(T source)
bool operator!=(QSpecialInteger< S > i) const
static constexpr QSpecialInteger max()
QSpecialInteger & operator<<=(T i)
QSpecialInteger & operator^=(T i)
QSpecialInteger & operator%=(T i)
constexpr QSpecialInteger(T i)
bool operator==(QSpecialInteger< S > i) const
QSpecialInteger & operator=(T i)
QSpecialInteger & operator&=(T i)
QSpecialInteger & operator++()
QSpecialInteger & operator>>=(T i)
QSpecialInteger & operator--()
QSpecialInteger & operator*=(T i)
QSpecialInteger & operator-=(T i)
QSpecialInteger & operator+=(T i)
QSpecialInteger()=default
QSpecialInteger & operator|=(T i)
static constexpr QSpecialInteger min()
QSpecialInteger & operator/=(T i)
Provides 16-bit floating point support.
QString & operator+=(QString &that, const ProString &other)
constexpr bool operator!=(const timespec &t1, const timespec &t2)
QBEInteger< quint64 > quint64_be
quint8 qFromLittleEndian< quint8 >(const void *src)
QLEInteger< qint64 > qint64_le
Q_CORE_EXPORT void * qbswap< 2 >(const void *source, qsizetype count, void *dest) noexcept
QBEInteger< qint32 > qint32_be
QLEInteger< qint32 > qint32_le
QBEInteger< qint64 > qint64_be
QLEInteger< quint32 > quint32_le
QLEInteger< quint64 > quint64_le
constexpr quint64 qbswap_helper(quint64 source)
Q_CORE_EXPORT void * qbswap< 8 >(const void *source, qsizetype count, void *dest) noexcept
constexpr T qbswap(T source)
QBEInteger< quint32 > quint32_be
constexpr T qFromLittleEndian(T source)
constexpr T qToBigEndian(T source)
QLEInteger< quint16 > quint16_le
QSpecialInteger< QBigEndianStorageType< T > > QBEInteger
QLEInteger< qint16 > qint16_le
constexpr T qFromBigEndian(T source)
QT_BEGIN_NAMESPACE Q_ALWAYS_INLINE void qToUnaligned(const T src, void *dest)
QSpecialInteger< QLittleEndianStorageType< T > > QLEInteger
qint8 qFromBigEndian< qint8 >(const void *src)
QBEInteger< qint16 > qint16_be
quint8 qFromBigEndian< quint8 >(const void *src)
QBEInteger< quint16 > quint16_be
void * qbswap< 1 >(const void *source, qsizetype count, void *dest) noexcept
constexpr T qToLittleEndian(T source)
Q_ALWAYS_INLINE T qFromUnaligned(const void *src)
The <QtEndian> header provides functions to convert between little and big endian representations of ...
Q_CORE_EXPORT void * qbswap< 4 >(const void *source, qsizetype count, void *dest) noexcept
qint8 qFromLittleEndian< qint8 >(const void *src)
Float qbswapFloatHelper(Float source)
unsigned long long quint64
QT_BEGIN_NAMESPACE typedef signed char qint8
bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLsizei GLsizei GLchar * source
QUrl::FormattingOptions & operator|=(QUrl::FormattingOptions &i, QUrl::ComponentFormattingOptions f)