| 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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 FX_CHAR* pBuffer = (FX_CHAR*)(this + 1); | 1155 FX_CHAR* pBuffer = (FX_CHAR*)(this + 1); |
| 1156 FXSYS_memcpy32(pBuffer + m_Size, str.GetPtr(), len); | 1156 FXSYS_memcpy32(pBuffer + m_Size, str.GetPtr(), len); |
| 1157 m_Size += len; | 1157 m_Size += len; |
| 1158 } | 1158 } |
| 1159 void CFX_StringBufBase::Append(int i, FX_DWORD flags) | 1159 void CFX_StringBufBase::Append(int i, FX_DWORD flags) |
| 1160 { | 1160 { |
| 1161 char buf[32]; | 1161 char buf[32]; |
| 1162 int len = _Buffer_itoa(buf, i, flags); | 1162 int len = _Buffer_itoa(buf, i, flags); |
| 1163 Append(CFX_ByteStringC(buf, len)); | 1163 Append(CFX_ByteStringC(buf, len)); |
| 1164 } | 1164 } |
| OLD | NEW |