Chromium Code Reviews| 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 #ifndef CORE_FXCRT_INCLUDE_FX_STRING_H_ | 7 #ifndef CORE_FXCRT_INCLUDE_FX_STRING_H_ |
| 8 #define CORE_FXCRT_INCLUDE_FX_STRING_H_ | 8 #define CORE_FXCRT_INCLUDE_FX_STRING_H_ |
| 9 | 9 |
| 10 #include <stdint.h> // For intptr_t. | 10 #include <stdint.h> // For intptr_t. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 86 FXSYS_memcmp(other.m_Ptr, m_Ptr, m_Length) == 0; | 86 FXSYS_memcmp(other.m_Ptr, m_Ptr, m_Length) == 0; |
| 87 } | 87 } |
| 88 bool operator!=(const char* ptr) const { return !(*this == ptr); } | 88 bool operator!=(const char* ptr) const { return !(*this == ptr); } |
| 89 bool operator!=(const CFX_ByteStringC& other) const { | 89 bool operator!=(const CFX_ByteStringC& other) const { |
| 90 return !(*this == other); | 90 return !(*this == other); |
| 91 } | 91 } |
| 92 | 92 |
| 93 uint32_t GetID(FX_STRSIZE start_pos = 0) const; | 93 uint32_t GetID(FX_STRSIZE start_pos = 0) const; |
| 94 | 94 |
| 95 const uint8_t* GetPtr() const { return m_Ptr; } | 95 const uint8_t* GetPtr() const { return m_Ptr; } |
| 96 const FX_CHAR* GetCStr() const { return (const FX_CHAR*)m_Ptr; } | 96 const FX_CHAR* c_str() const { return (const FX_CHAR*)m_Ptr; } |
|
Tom Sepez
2016/04/04 18:22:40
nit: reinterpret cast.
dsinclair
2016/04/04 18:33:34
Done.
| |
| 97 | 97 |
| 98 FX_STRSIZE GetLength() const { return m_Length; } | 98 FX_STRSIZE GetLength() const { return m_Length; } |
| 99 bool IsEmpty() const { return m_Length == 0; } | 99 bool IsEmpty() const { return m_Length == 0; } |
| 100 | 100 |
| 101 uint8_t GetAt(FX_STRSIZE index) const { return m_Ptr[index]; } | 101 uint8_t GetAt(FX_STRSIZE index) const { return m_Ptr[index]; } |
| 102 | 102 |
| 103 CFX_ByteStringC Mid(FX_STRSIZE index, FX_STRSIZE count = -1) const { | 103 CFX_ByteStringC Mid(FX_STRSIZE index, FX_STRSIZE count = -1) const { |
| 104 if (index < 0) { | 104 if (index < 0) { |
| 105 index = 0; | 105 index = 0; |
| 106 } | 106 } |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 757 } | 757 } |
| 758 | 758 |
| 759 FX_FLOAT FX_atof(const CFX_ByteStringC& str); | 759 FX_FLOAT FX_atof(const CFX_ByteStringC& str); |
| 760 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { | 760 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { |
| 761 return FX_atof(FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength())); | 761 return FX_atof(FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength())); |
| 762 } | 762 } |
| 763 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); | 763 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); |
| 764 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); | 764 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); |
| 765 | 765 |
| 766 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ | 766 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ |
| OLD | NEW |