Index: sources/utility/format.cpp =================================================================== diff -u -r56e378f7504701b9e9a9dccaf205aef2fd52c58e -r12e7b6dda53cf8db7707c7fa55dcf6137e7d6997 --- sources/utility/format.cpp (.../format.cpp) (revision 56e378f7504701b9e9a9dccaf205aef2fd52c58e) +++ sources/utility/format.cpp (.../format.cpp) (revision 12e7b6dda53cf8db7707c7fa55dcf6137e7d6997) @@ -21,6 +21,14 @@ Format::Format() { } +/*! + * \brief Format::toHexString + * \details converts the unsigned int 16 bit value vValue to QString. + * \param vValue - value to convert. + * \param vWith0x - adds 0x to the output. + * \param vLen - length of the output string. + * \return QString + */ QString Format::toHexString(quint16 vValue, bool vWith0x, quint8 vLen) { if ( vWith0x ) { return "0x" + QString("%1").arg(vValue,0,16).rightJustified(vLen, '0').toUpper(); @@ -29,11 +37,27 @@ } } +/*! + * \brief Format::toHexByteArray + * \details Returns a hex encoded copy of the byte array. + * The hex encoding uses the numbers 0-9 and the letters a-f. + * Also converts to uppercase. + * \param vData - Data to convert + * \param separator - separator to put in string output in the middle of each byte. + * \return + */ QByteArray Format::toHexByteArray(const QByteArray &vData, char separator) { return vData.toHex(separator).toUpper(); } +/*! + * \brief Format::toHexString + * \details Converts the vData of QByteArray to Hex representation of QString + * \param vData - Data to convert + * \param separator - separator to put in string output in the middle of each byte. + * \return QString + */ QString Format::toHexString(const QByteArray &vData, char separator) { QString string = toHexByteArray(vData, separator); @@ -101,6 +125,14 @@ return mData; } +/*! + * \brief Format::toStringList + * \details Converts the list of of character base items in List of string items. + * \param vList - list of the character base items + * \param vRemoveDuplicate - remove duplicate items if true + * \param vPrefix - add the prefix vPrefix to each item + * \return The QStringList conversion of the character base items vList. + */ QStringList Format::toStringList(const QList vList, bool vRemoveDuplicate, QString vPrefix) { QStringList list;