diff options
author | Javier <maemo@javispedro.com> | 2014-05-20 01:47:23 +0200 |
---|---|---|
committer | Javier <maemo@javispedro.com> | 2014-05-20 01:47:23 +0200 |
commit | e0677f561465615d84ca81b48955dbf8e169e02e (patch) | |
tree | 339fb87fbacba43ad514d8017d0f8c8a332732d3 /gatouuid.h | |
parent | 6163f146b2951c492de312365161b8a0f9d1afd1 (diff) | |
download | libgato-e0677f561465615d84ca81b48955dbf8e169e02e.tar.gz libgato-e0677f561465615d84ca81b48955dbf8e169e02e.zip |
remove gatouint128, simplify gatouuid encoding
Diffstat (limited to 'gatouuid.h')
-rw-r--r-- | gatouuid.h | 42 |
1 files changed, 1 insertions, 41 deletions
@@ -8,41 +8,6 @@ class GatoUUIDPrivate; -struct gatouint128 -{ - quint8 data[16]; -}; - -template<> -inline LIBGATO_EXPORT gatouint128 qFromLittleEndian<gatouint128>(const uchar *src) -{ - gatouint128 dest; -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - for (int i = 0; i < 16; i++) { - dest.data[i] = src[i]; - } -#else - for (int i = 0; i < 16; i++) { - dest.data[i] = src[15 - i]; - } -#endif - return dest; -} - -template<> -inline LIBGATO_EXPORT void qToLittleEndian<gatouint128>(gatouint128 src, uchar *dest) -{ -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - for (int i = 0; i < 16; i++) { - dest[i] = src.data[i]; - } -#else - for (int i = 0; i < 16; i++) { - dest[i] = src.data[15 - i]; - } -#endif -} - class LIBGATO_EXPORT GatoUUID : public QUuid { public: @@ -71,7 +36,6 @@ public: GatoUUID(GattUuid uuid); explicit GatoUUID(quint16 uuid); explicit GatoUUID(quint32 uuid); - explicit GatoUUID(gatouint128 uuid); explicit GatoUUID(const QString &uuid); GatoUUID(const GatoUUID &o); GatoUUID(const QUuid &uuid); @@ -81,14 +45,10 @@ public: quint16 toUInt16(bool *ok = 0) const; quint32 toUInt32(bool *ok = 0) const; - gatouint128 toUInt128() const; }; LIBGATO_EXPORT QDebug operator<<(QDebug debug, const GatoUUID &uuid); -LIBGATO_EXPORT QDataStream & operator<<(QDataStream &s, const gatouint128 &u); -LIBGATO_EXPORT QDataStream & operator>>(QDataStream &s, gatouint128 &u); - -LIBGATO_EXPORT uint qHash(const GatoUUID &a); +LIBGATO_EXPORT uint qHash(const GatoUUID &a, uint seed = 0); #endif // GATOUUID_H |