OLD | NEW |
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 #include "../../include/fxcrt/fx_basic.h" | 7 #include "../../include/fxcrt/fx_basic.h" |
8 #include "../../../third_party/base/numerics/safe_math.h" | 8 #include "../../../third_party/base/numerics/safe_math.h" |
9 | 9 |
10 static int _Buffer_itoa(char* buf, int i, FX_DWORD flags) | 10 static int _Buffer_itoa(char* buf, int i, FX_DWORD flags) |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 bool CFX_ByteString::EqualNoCase(FX_BSTR str) const | 269 bool CFX_ByteString::EqualNoCase(FX_BSTR str) const |
270 { | 270 { |
271 if (m_pData == NULL) { | 271 if (m_pData == NULL) { |
272 return str.IsEmpty(); | 272 return str.IsEmpty(); |
273 } | 273 } |
274 FX_STRSIZE len = str.GetLength(); | 274 FX_STRSIZE len = str.GetLength(); |
275 if (m_pData->m_nDataLength != len) { | 275 if (m_pData->m_nDataLength != len) { |
276 return false; | 276 return false; |
277 } | 277 } |
278 FX_LPCBYTE pThis = (FX_LPCBYTE)m_pData->m_String; | 278 FX_LPCBYTE pThis = (FX_LPCBYTE)m_pData->m_String; |
279 FX_LPCBYTE pThat = (FX_LPCBYTE)str; | 279 FX_LPCBYTE pThat = str.GetPtr(); |
280 for (FX_STRSIZE i = 0; i < len; i ++) { | 280 for (FX_STRSIZE i = 0; i < len; i ++) { |
281 if ((*pThis) != (*pThat)) { | 281 if ((*pThis) != (*pThat)) { |
282 FX_BYTE bThis = *pThis; | 282 FX_BYTE bThis = *pThis; |
283 if (bThis >= 'A' && bThis <= 'Z') { | 283 if (bThis >= 'A' && bThis <= 'Z') { |
284 bThis += 'a' - 'A'; | 284 bThis += 'a' - 'A'; |
285 } | 285 } |
286 FX_BYTE bThat = *pThat; | 286 FX_BYTE bThat = *pThat; |
287 if (bThat >= 'A' && bThat <= 'Z') { | 287 if (bThat >= 'A' && bThat <= 'Z') { |
288 bThat += 'a' - 'A'; | 288 bThat += 'a' - 'A'; |
289 } | 289 } |
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 scale /= 10; | 1130 scale /= 10; |
1131 } | 1131 } |
1132 return buf_size; | 1132 return buf_size; |
1133 } | 1133 } |
1134 CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision) | 1134 CFX_ByteString CFX_ByteString::FormatFloat(FX_FLOAT d, int precision) |
1135 { | 1135 { |
1136 FX_CHAR buf[32]; | 1136 FX_CHAR buf[32]; |
1137 FX_STRSIZE len = FX_ftoa(d, buf); | 1137 FX_STRSIZE len = FX_ftoa(d, buf); |
1138 return CFX_ByteString(buf, len); | 1138 return CFX_ByteString(buf, len); |
1139 } | 1139 } |
OLD | NEW |