diff options
author | Thomas Groman <tgroman@nuegia.net> | 2019-09-19 00:41:48 -0700 |
---|---|---|
committer | Thomas Groman <tgroman@nuegia.net> | 2019-09-19 00:41:48 -0700 |
commit | 32b3ed0a1362a4b0798ad71fac3450fb77cb7e41 (patch) | |
tree | 7be7a2f602e6a5af7bc2db86bef9cf2a659c3d3d /libraries/iconfix/internal/qhexstring_p.h | |
parent | 5fb2c6334e7d5237db11695b4c0ec0f2d1e47c88 (diff) | |
download | MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar.gz MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar.lz MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.tar.xz MultiMC-32b3ed0a1362a4b0798ad71fac3450fb77cb7e41.zip |
merged from 0.6.7 codebase
Diffstat (limited to 'libraries/iconfix/internal/qhexstring_p.h')
-rw-r--r-- | libraries/iconfix/internal/qhexstring_p.h | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/libraries/iconfix/internal/qhexstring_p.h b/libraries/iconfix/internal/qhexstring_p.h index f01b4cdd..c81904e5 100644 --- a/libraries/iconfix/internal/qhexstring_p.h +++ b/libraries/iconfix/internal/qhexstring_p.h @@ -61,40 +61,40 @@ // internal helper. Converts an integer value to an unique string token template <typename T> struct HexString { - inline HexString(const T t) : val(t) - { - } + inline HexString(const T t) : val(t) + { + } - inline void write(QChar *&dest) const - { - const ushort hexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; - const char *c = reinterpret_cast<const char *>(&val); - for (uint i = 0; i < sizeof(T); ++i) - { - *dest++ = hexChars[*c & 0xf]; - *dest++ = hexChars[(*c & 0xf0) >> 4]; - ++c; - } - } - const T val; + inline void write(QChar *&dest) const + { + const ushort hexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + const char *c = reinterpret_cast<const char *>(&val); + for (uint i = 0; i < sizeof(T); ++i) + { + *dest++ = hexChars[*c & 0xf]; + *dest++ = hexChars[(*c & 0xf0) >> 4]; + ++c; + } + } + const T val; }; // specialization to enable fast concatenating of our string tokens to a string template <typename T> struct QConcatenable<HexString<T>> { - typedef HexString<T> type; - enum - { - ExactSize = true - }; - static int size(const HexString<T> &) - { - return sizeof(T) * 2; - } - static inline void appendTo(const HexString<T> &str, QChar *&out) - { - str.write(out); - } - typedef QString ConvertTo; + typedef HexString<T> type; + enum + { + ExactSize = true + }; + static int size(const HexString<T> &) + { + return sizeof(T) * 2; + } + static inline void appendTo(const HexString<T> &str, QChar *&out) + { + str.write(out); + } + typedef QString ConvertTo; }; |