Index: sources/utility/format.cpp =================================================================== diff -u -r618891879f5cdc68e37ee68eea005afb76dd4e5b -rbb74da05f81b82dad3ec844c1feb1135b949f1c2 --- sources/utility/format.cpp (.../format.cpp) (revision 618891879f5cdc68e37ee68eea005afb76dd4e5b) +++ sources/utility/format.cpp (.../format.cpp) (revision bb74da05f81b82dad3ec844c1feb1135b949f1c2) @@ -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;