Add 64bit unsigned integer handling in network string
This commit is contained in:
@@ -255,6 +255,21 @@ public:
|
||||
return *this;
|
||||
} // addUInt32
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Adds unsigned 64 bit integer. */
|
||||
BareNetworkString& addUInt64(const uint64_t& value)
|
||||
{
|
||||
m_buffer.push_back((value >> 56) & 0xff);
|
||||
m_buffer.push_back((value >> 48) & 0xff);
|
||||
m_buffer.push_back((value >> 40) & 0xff);
|
||||
m_buffer.push_back((value >> 32) & 0xff);
|
||||
m_buffer.push_back((value >> 24) & 0xff);
|
||||
m_buffer.push_back((value >> 16) & 0xff);
|
||||
m_buffer.push_back((value >> 8) & 0xff);
|
||||
m_buffer.push_back( value & 0xff);
|
||||
return *this;
|
||||
} // addUInt64
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/** Adds a 4 byte floating point value. */
|
||||
BareNetworkString& addFloat(const float value)
|
||||
@@ -306,6 +321,9 @@ public:
|
||||
|
||||
// Functions related to getting data from a network string
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns a unsigned 64 bit integer. */
|
||||
inline uint64_t getUInt64() const { return get<uint64_t, 8>(); }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns a unsigned 32 bit integer. */
|
||||
inline uint32_t getUInt32() const { return get<uint32_t, 4>(); }
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user