diff options
Diffstat (limited to 'common/utils.h')
-rw-r--r-- | common/utils.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/common/utils.h b/common/utils.h index 253de61..7066d79 100644 --- a/common/utils.h +++ b/common/utils.h | |||
@@ -20,6 +20,17 @@ | |||
20 | 20 | ||
21 | #include <QByteArray> | 21 | #include <QByteArray> |
22 | 22 | ||
23 | #include <cmath> | ||
24 | |||
23 | namespace Sink { | 25 | namespace Sink { |
24 | QByteArray createUuid(); | 26 | |
27 | QByteArray createUuid(); | ||
28 | |||
29 | template <typename T> | ||
30 | static QByteArray padNumber(T number) | ||
31 | { | ||
32 | static T uint_num_digits = (T)std::log10(std::numeric_limits<T>::max()) + 1; | ||
33 | return QByteArray::number(number).rightJustified(uint_num_digits, '0'); | ||
25 | } | 34 | } |
35 | |||
36 | } // namespace Sink | ||