Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Common/StringToInt.cpp')
-rwxr-xr-xCommon/StringToInt.cpp19
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;