| 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 <cstdlib> | 8 #include <cstdlib> |
| 9 #include <cstring> | 9 #include <cstring> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 void append(char c) | 166 void append(char c) |
| 167 { | 167 { |
| 168 m_impl += c; | 168 m_impl += c; |
| 169 } | 169 } |
| 170 | 170 |
| 171 void appendNumber(int i) | 171 void appendNumber(int i) |
| 172 { | 172 { |
| 173 m_impl = m_impl + String16::number(i).impl(); | 173 m_impl = m_impl + String16::number(i).impl(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void appendNumber(double d) |
| 177 { |
| 178 m_impl = m_impl + String16::fromDoubleFixedPrecision(d, 6).impl(); |
| 179 } |
| 180 |
| 176 void append(const UChar* c, size_t length) | 181 void append(const UChar* c, size_t length) |
| 177 { | 182 { |
| 178 // presubmit: allow wstring | 183 // presubmit: allow wstring |
| 179 m_impl += wstring(c, length); | 184 m_impl += wstring(c, length); |
| 180 } | 185 } |
| 181 | 186 |
| 182 void append(const char* c, size_t length) | 187 void append(const char* c, size_t length) |
| 183 { | 188 { |
| 184 m_impl += String16(c, length).impl(); | 189 m_impl += String16(c, length).impl(); |
| 185 } | 190 } |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 public: | 239 public: |
| 235 String() {}; | 240 String() {}; |
| 236 String(const String16& other) {}; | 241 String(const String16& other) {}; |
| 237 operator String16() const { return String16(); }; | 242 operator String16() const { return String16(); }; |
| 238 }; | 243 }; |
| 239 } // namespace WTF | 244 } // namespace WTF |
| 240 | 245 |
| 241 using String = WTF::String; | 246 using String = WTF::String; |
| 242 | 247 |
| 243 #endif // !defined(String16STL_h) | 248 #endif // !defined(String16STL_h) |
| OLD | NEW |