added {BE,LE}::getBytes24()

({BE,LE}::toUInt24() counterpart)
experiment/meta_header
Martchus 7 years ago
parent 6824565ea9
commit d04a0fe1a9
  1. 17
      conversion/binaryconversionprivate.h

@ -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.
*/

Loading…
Cancel
Save