| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium 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 #ifndef String16STL_h | 5 #ifndef String16STL_h |
| 6 #define String16STL_h | 6 #define String16STL_h |
| 7 | 7 |
| 8 #include <cctype> |
| 8 #include <cstdlib> | 9 #include <cstdlib> |
| 9 #include <cstring> | 10 #include <cstring> |
| 10 #include <stdint.h> | 11 #include <stdint.h> |
| 11 #include <string> | 12 #include <string> |
| 12 #include <vector> | 13 #include <vector> |
| 13 | 14 |
| 14 using UChar = uint16_t; | 15 using UChar = uint16_t; |
| 15 using UChar32 = uint32_t; | 16 using UChar32 = uint32_t; |
| 16 using LChar = unsigned char; | 17 using LChar = unsigned char; |
| 17 // presubmit: allow wstring | 18 // presubmit: allow wstring |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 static std::string intToString(int); | 135 static std::string intToString(int); |
| 135 static std::string doubleToString(double); | 136 static std::string doubleToString(double); |
| 136 // presubmit: allow wstring | 137 // presubmit: allow wstring |
| 137 wstring m_impl; | 138 wstring m_impl; |
| 138 mutable bool has_hash = false; | 139 mutable bool has_hash = false; |
| 139 mutable std::size_t hash_code = 0; | 140 mutable std::size_t hash_code = 0; |
| 140 }; | 141 }; |
| 141 | 142 |
| 142 static inline bool isSpaceOrNewline(UChar c) | 143 static inline bool isSpaceOrNewline(UChar c) |
| 143 { | 144 { |
| 144 return false; | 145 return std::isspace(c); // NOLINT |
| 145 } | 146 } |
| 146 | 147 |
| 147 class String16Builder { | 148 class String16Builder { |
| 148 public: | 149 public: |
| 149 String16Builder() { } | 150 String16Builder() { } |
| 150 | 151 |
| 151 void append(const String16& str) | 152 void append(const String16& str) |
| 152 { | 153 { |
| 153 m_impl += str.impl(); | 154 m_impl += str.impl(); |
| 154 } | 155 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } | 254 } |
| 254 }; | 255 }; |
| 255 | 256 |
| 256 } // namespace std | 257 } // namespace std |
| 257 | 258 |
| 258 #endif // !defined(__APPLE__) || defined(_LIBCPP_VERSION) | 259 #endif // !defined(__APPLE__) || defined(_LIBCPP_VERSION) |
| 259 | 260 |
| 260 using String = WTF::String; | 261 using String = WTF::String; |
| 261 | 262 |
| 262 #endif // !defined(String16STL_h) | 263 #endif // !defined(String16STL_h) |
| OLD | NEW |