summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-03-03 17:12:58 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-03-03 17:12:58 -0500
commit1c91537c9f9669246713a5be628493ae2fc4899a (patch)
treeb40c06fde5dd0410f4eb7a0734f11758aa6c5d37 /core/include
parent44beca7313284a60c21b4973d42f993b8c248ec9 (diff)
downloadpdfium-1c91537c9f9669246713a5be628493ae2fc4899a.tar.xz
Combine StrToInt methods.
This Cl combines the two StrToInt implementations. In doing so I had to add some more overrides to toDecimalDigit() and add a isDecimalDigit(). BUG=pdfium:423 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1757283002 .
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fxcrt/fx_ext.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h
index 3f4f668190..c8afb2b793 100644
--- a/core/include/fxcrt/fx_ext.h
+++ b/core/include/fxcrt/fx_ext.h
@@ -53,13 +53,21 @@ inline int FXSYS_toHexDigit(const FX_CHAR c) {
return upchar > '9' ? upchar - 'A' + 10 : upchar - '0';
}
+inline bool FXSYS_isDecimalDigit(const FX_CHAR c) {
+ return std::isdigit(c);
+}
+
+inline bool FXSYS_isDecimalDigit(const FX_WCHAR c) {
+ return std::iswdigit(c);
+}
+
inline int FXSYS_toDecimalDigit(const FX_CHAR c) {
if (!std::isdigit(c))
return 0;
return c - '0';
}
-inline int FXSYS_toDecimalDigitWide(const FX_WCHAR c) {
+inline int FXSYS_toDecimalDigit(const FX_WCHAR c) {
if (!std::iswdigit(c))
return 0;
return c - L'0';