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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 private: | 128 private: |
129 void* operator new(size_t) throw() { return NULL; } | 129 void* operator new(size_t) throw() { return NULL; } |
130 }; | 130 }; |
131 inline bool operator==(const char* lhs, const CFX_ByteStringC& rhs) { | 131 inline bool operator==(const char* lhs, const CFX_ByteStringC& rhs) { |
132 return rhs == lhs; | 132 return rhs == lhs; |
133 } | 133 } |
134 inline bool operator!=(const char* lhs, const CFX_ByteStringC& rhs) { | 134 inline bool operator!=(const char* lhs, const CFX_ByteStringC& rhs) { |
135 return rhs != lhs; | 135 return rhs != lhs; |
136 } | 136 } |
137 #define FXBSTR_ID(c1, c2, c3, c4) ((c1 << 24) | (c2 << 16) | (c3 << 8) | (c4)) | 137 #define FXBSTR_ID(c1, c2, c3, c4) \ |
| 138 (((uint32_t)c1 << 24) | ((uint32_t)c2 << 16) | ((uint32_t)c3 << 8) | \ |
| 139 ((uint32_t)c4)) |
138 | 140 |
139 // A mutable string with shared buffers using copy-on-write semantics that | 141 // A mutable string with shared buffers using copy-on-write semantics that |
140 // avoids the cost of std::string's iterator stability guarantees. | 142 // avoids the cost of std::string's iterator stability guarantees. |
141 class CFX_ByteString { | 143 class CFX_ByteString { |
142 public: | 144 public: |
143 typedef FX_CHAR value_type; | 145 typedef FX_CHAR value_type; |
144 | 146 |
145 CFX_ByteString() : m_pData(nullptr) {} | 147 CFX_ByteString() : m_pData(nullptr) {} |
146 | 148 |
147 // Copy constructor. | 149 // Copy constructor. |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 } | 812 } |
811 | 813 |
812 FX_FLOAT FX_atof(const CFX_ByteStringC& str); | 814 FX_FLOAT FX_atof(const CFX_ByteStringC& str); |
813 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { | 815 inline FX_FLOAT FX_atof(const CFX_WideStringC& wsStr) { |
814 return FX_atof(FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength())); | 816 return FX_atof(FX_UTF8Encode(wsStr.GetPtr(), wsStr.GetLength())); |
815 } | 817 } |
816 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); | 818 void FX_atonum(const CFX_ByteStringC& str, FX_BOOL& bInteger, void* pData); |
817 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); | 819 FX_STRSIZE FX_ftoa(FX_FLOAT f, FX_CHAR* buf); |
818 | 820 |
819 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ | 821 #endif // CORE_FXCRT_INCLUDE_FX_STRING_H_ |
OLD | NEW |