diff options
author | kh1 <karsten.heimrich@nokia.com> | 2012-03-15 14:53:47 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@nokia.com> | 2012-03-19 16:14:04 +0100 |
commit | be3b47d0d504a3409ce66bd77bb8c0acff87c4f5 (patch) | |
tree | 09dfb02d484a4f395991972b828da71400fb761a /src/libs/7zip/win/CPP/7zip/Common/MethodId.cpp | |
parent | 9fd62353cf7f973d78cd2093328ac15b5c4980b6 (diff) |
Reorganize the tree, have better ifw.pri. Shadow build support.
Change-Id: I01fb12537f863ed0744979973c7e4153889cc5cb
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'src/libs/7zip/win/CPP/7zip/Common/MethodId.cpp')
-rw-r--r-- | src/libs/7zip/win/CPP/7zip/Common/MethodId.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/libs/7zip/win/CPP/7zip/Common/MethodId.cpp b/src/libs/7zip/win/CPP/7zip/Common/MethodId.cpp new file mode 100644 index 000000000..b797b6857 --- /dev/null +++ b/src/libs/7zip/win/CPP/7zip/Common/MethodId.cpp @@ -0,0 +1,27 @@ +// MethodId.cpp + +#include "StdAfx.h" + +#include "MethodId.h" +#include "../../Common/MyString.h" + +static inline wchar_t GetHex(Byte value) +{ + return (wchar_t)((value < 10) ? ('0' + value) : ('A' + (value - 10))); +} + +UString ConvertMethodIdToString(UInt64 id) +{ + wchar_t s[32]; + int len = 32; + s[--len] = 0; + do + { + s[--len] = GetHex((Byte)id & 0xF); + id >>= 4; + s[--len] = GetHex((Byte)id & 0xF); + id >>= 4; + } + while (id != 0); + return s + len; +} |