diff options
| author | Ahmad Samir <a.samirh78@gmail.com> | 2023-01-17 20:54:52 +0200 |
|---|---|---|
| committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-02-07 20:04:11 +0200 |
| commit | 498f3452285aa44580e1d03baeec126d475f8401 (patch) | |
| tree | 6307934b58045f6b6761023f769844d87cdc63ca /src/corelib/serialization/qtextstream.cpp | |
| parent | 9a8b9473d5f0fd4639193481ba9b344d91f3f00a (diff) | |
QtMiscUtils: add some more character helpers
isHexDigit, isOctalDigit, isAsciiDigit, isAsciiLower, isAsciiUpper,
isAsciiLetterOrNumber.
This de-duplicates some code through out.
Rename two local lambdas that were called "isAsciiLetterOrNumber" to not
conflict with the method in QtMiscUtils.
Change-Id: I5b631f95b9f109136d19515f7e20b8e2fbca3d43
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/serialization/qtextstream.cpp')
| -rw-r--r-- | src/corelib/serialization/qtextstream.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp index 83e97c834d0..806616aaf4e 100644 --- a/src/corelib/serialization/qtextstream.cpp +++ b/src/corelib/serialization/qtextstream.cpp @@ -196,6 +196,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; #include "qnumeric.h" #include "qvarlengtharray.h" #include <private/qdebug_p.h> +#include <private/qtools_p.h> #include <locale.h> #include "private/qlocale_p.h" @@ -245,6 +246,7 @@ static const int QTEXTSTREAM_BUFFERSIZE = 16384; QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; +using namespace QtMiscUtils; //------------------------------------------------------------------- @@ -1686,7 +1688,7 @@ QTextStreamPrivate::NumberParsingStatus QTextStreamPrivate::getNumber(qulonglong int ndigits = 0; while (getChar(&dig)) { int n = dig.toLower().unicode(); - if (n >= '0' && n <= '7') { + if (isOctalDigit(n)) { val *= 8; val += n - '0'; } else { |
