Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(789)

Side by Side Diff: core/include/fxcrt/fx_ext.h

Issue 1530763005: Correctly extracting email addresses (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: more comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « BUILD.gn ('k') | core/src/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_INCLUDE_FXCRT_FX_EXT_H_ 7 #ifndef CORE_INCLUDE_FXCRT_FX_EXT_H_
8 #define CORE_INCLUDE_FXCRT_FX_EXT_H_ 8 #define CORE_INCLUDE_FXCRT_FX_EXT_H_
9 9
10 #include <cctype> 10 #include <cctype>
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 inline FX_BOOL FXSYS_isupper(int32_t ch) { 30 inline FX_BOOL FXSYS_isupper(int32_t ch) {
31 return ch >= 'A' && ch <= 'Z'; 31 return ch >= 'A' && ch <= 'Z';
32 } 32 }
33 inline int32_t FXSYS_tolower(int32_t ch) { 33 inline int32_t FXSYS_tolower(int32_t ch) {
34 return ch < 'A' || ch > 'Z' ? ch : (ch + 0x20); 34 return ch < 'A' || ch > 'Z' ? ch : (ch + 0x20);
35 } 35 }
36 inline int32_t FXSYS_toupper(int32_t ch) { 36 inline int32_t FXSYS_toupper(int32_t ch) {
37 return ch < 'a' || ch > 'z' ? ch : (ch - 0x20); 37 return ch < 'a' || ch > 'z' ? ch : (ch - 0x20);
38 } 38 }
39 inline FX_BOOL FXSYS_iswalpha(wchar_t wch) {
40 return (wch >= L'A' && wch <= L'Z') || (wch >= L'a' && wch <= L'z');
41 }
42 inline FX_BOOL FXSYS_iswdigit(wchar_t wch) {
43 return wch >= L'0' && wch <= L'9';
44 }
45 inline FX_BOOL FXSYS_iswalnum(wchar_t wch) {
46 return FXSYS_iswalpha(wch) || FXSYS_iswdigit(wch);
47 }
39 48
40 inline int FXSYS_toHexDigit(const FX_CHAR c) { 49 inline int FXSYS_toHexDigit(const FX_CHAR c) {
41 if (!std::isxdigit(c)) 50 if (!std::isxdigit(c))
42 return 0; 51 return 0;
43 char upchar = std::toupper(c); 52 char upchar = std::toupper(c);
44 return upchar > '9' ? upchar - 'A' + 10 : upchar - '0'; 53 return upchar > '9' ? upchar - 'A' + 10 : upchar - '0';
45 } 54 }
46 55
47 inline int FXSYS_toDecimalDigit(const FX_CHAR c) { 56 inline int FXSYS_toDecimalDigit(const FX_CHAR c) {
48 if (!std::isdigit(c)) 57 if (!std::isdigit(c))
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 j -= gap; 101 j -= gap;
93 } 102 }
94 pArray[j + gap] = v1; 103 pArray[j + gap] = v1;
95 } 104 }
96 gap >>= 1; 105 gap >>= 1;
97 } 106 }
98 } 107 }
99 }; 108 };
100 109
101 #endif // CORE_INCLUDE_FXCRT_FX_EXT_H_ 110 #endif // CORE_INCLUDE_FXCRT_FX_EXT_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | core/src/fpdftext/fpdf_text_int.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698