diff options
Diffstat (limited to 'Common/StringToInt.cpp')
-rwxr-xr-x | Common/StringToInt.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Common/StringToInt.cpp b/Common/StringToInt.cpp index 9f02ec9d..1fa8ef21 100755 --- a/Common/StringToInt.cpp +++ b/Common/StringToInt.cpp @@ -22,6 +22,25 @@ UInt64 ConvertStringToUInt64(const char *s, const char **end) } } +UInt64 ConvertOctStringToUInt64(const char *s, const char **end) +{ + UInt64 result = 0; + while(true) + { + char c = *s; + if (c < '0' || c > '7') + { + if (end != NULL) + *end = s; + return result; + } + result <<= 3; + result += (c - '0'); + s++; + } +} + + UInt64 ConvertStringToUInt64(const wchar_t *s, const wchar_t **end) { UInt64 result = 0; |