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

Side by Side Diff: fpdfsdk/src/javascript/PublicMethods.h

Issue 1582013002: Cleanup CJS_PublicMethods::ParseNumber (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Update bug_361_expected.txt Created 4 years, 11 months 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 | « fpdfsdk/src/javascript/Field.cpp ('k') | fpdfsdk/src/javascript/PublicMethods.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 FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ 7 #ifndef FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
8 #define FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ 8 #define FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
9 9
10 #include "JS_Define.h" 10 #include "JS_Define.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 int& nSkip, 137 int& nSkip,
138 int nMaxStep); 138 int nMaxStep);
139 static CFX_WideString ParseStringString(const CFX_WideString& string, 139 static CFX_WideString ParseStringString(const CFX_WideString& string,
140 int nStart, 140 int nStart,
141 int& nSkip); 141 int& nSkip);
142 static double MakeRegularDate(const CFX_WideString& value, 142 static double MakeRegularDate(const CFX_WideString& value,
143 const CFX_WideString& format, 143 const CFX_WideString& format,
144 bool* bWrongFormat); 144 bool* bWrongFormat);
145 static CFX_WideString MakeFormatDate(double dDate, 145 static CFX_WideString MakeFormatDate(double dDate,
146 const CFX_WideString& format); 146 const CFX_WideString& format);
147 static FX_BOOL ConvertStringToNumber(const FX_WCHAR* swSource, 147 static FX_BOOL ConvertStringToNumber(const FX_WCHAR* swSource, double& dRet);
148 double& dRet,
149 FX_BOOL& bDot);
150 static double ParseStringToNumber(const FX_WCHAR* swSource); 148 static double ParseStringToNumber(const FX_WCHAR* swSource);
151 static double ParseNormalDate(const CFX_WideString& value, 149 static double ParseNormalDate(const CFX_WideString& value,
152 bool* bWrongFormat); 150 bool* bWrongFormat);
153 static double MakeInterDate(CFX_WideString strValue); 151 static double MakeInterDate(CFX_WideString strValue);
154 static double ParseNumber(const FX_WCHAR* swSource,
155 FX_BOOL& bAllDigits,
156 FX_BOOL& bDot,
157 FX_BOOL& bSign,
158 FX_BOOL& bKXJS);
159 152
160 public: 153 public:
161 static CFX_WideString StrLTrim(const FX_WCHAR* pStr); 154 static CFX_WideString StrLTrim(const FX_WCHAR* pStr);
162 static CFX_WideString StrRTrim(const FX_WCHAR* pStr); 155 static CFX_WideString StrRTrim(const FX_WCHAR* pStr);
163 static CFX_WideString StrTrim(const FX_WCHAR* pStr); 156 static CFX_WideString StrTrim(const FX_WCHAR* pStr);
164 157
165 static CFX_ByteString StrLTrim(const FX_CHAR* pStr); 158 static CFX_ByteString StrLTrim(const FX_CHAR* pStr);
166 static CFX_ByteString StrRTrim(const FX_CHAR* pStr); 159 static CFX_ByteString StrRTrim(const FX_CHAR* pStr);
167 static CFX_ByteString StrTrim(const FX_CHAR* pStr); 160 static CFX_ByteString StrTrim(const FX_CHAR* pStr);
168 161
169 static FX_BOOL IsNumber(const FX_CHAR* string); 162 static FX_BOOL IsNumber(const FX_CHAR* string);
170 static FX_BOOL IsNumber(const FX_WCHAR* string); 163 static FX_BOOL IsNumber(const FX_WCHAR* string);
171 164
172 static FX_BOOL maskSatisfied(wchar_t c_Change, wchar_t c_Mask); 165 static FX_BOOL maskSatisfied(wchar_t c_Change, wchar_t c_Mask);
173 static FX_BOOL isReservedMaskChar(wchar_t ch); 166 static FX_BOOL isReservedMaskChar(wchar_t ch);
174 167
175 static double AF_Simple(const FX_WCHAR* sFuction, 168 static double AF_Simple(const FX_WCHAR* sFuction,
176 double dValue1, 169 double dValue1,
177 double dValue2); 170 double dValue2);
178 static CJS_Array AF_MakeArrayFromList(CJS_Runtime* pRuntime, CJS_Value val); 171 static CJS_Array AF_MakeArrayFromList(CJS_Runtime* pRuntime, CJS_Value val);
179 }; 172 };
180 173
181 #endif // FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ 174 #endif // FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/Field.cpp ('k') | fpdfsdk/src/javascript/PublicMethods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698