added {BE,LE}::getBytes24()

({BE,LE}::toUInt24() counterpart)
This commit is contained in:
Martchus 2016-01-25 23:59:05 +01:00
parent 6824565ea9
commit d04a0fe1a9
1 changed files with 17 additions and 0 deletions

View File

@ -200,6 +200,23 @@ LIB_EXPORT inline void getBytes(uint16 value, char *outputbuffer)
#endif
}
/*!
* \brief Stores the specified 24-bit unsigned integer value at a specified position in a char array.
* \remarks Ignores the most significant byte.
*/
LIB_EXPORT inline void getBytes24(uint32 value, char *outputbuffer)
{
#if CONVERSION_UTILITIES_BINARY_CONVERSION_INTERNAL == 0
outputbuffer[0] = static_cast<char>((value >> 16) & 0xFF);
outputbuffer[1] = static_cast<char>((value >> 8) & 0xFF);
outputbuffer[2] = static_cast<char>((value ) & 0xFF);
#else
outputbuffer[2] = static_cast<char>((value >> 16) & 0xFF);
outputbuffer[1] = static_cast<char>((value >> 8) & 0xFF);
outputbuffer[0] = static_cast<char>((value ) & 0xFF);
#endif
}
/*!
* \brief Stores the specified 32-bit signed integer value at a specified position in a char array.
*/