| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include "wtf/text/StringConcatenate.h" | 7 #include "wtf/text/StringConcatenate.h" |
| 8 | 8 |
| 9 // This macro is helpful for testing how many intermediate Strings are created w
hile evaluating an | 9 // This macro is helpful for testing how many intermediate Strings are created |
| 10 // expression containing operator+. | 10 // while evaluating an expression containing operator+. |
| 11 #ifndef WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING | 11 #ifndef WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING |
| 12 #define WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING() ((void)0) | 12 #define WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING() ((void)0) |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 void WTF::StringTypeAdapter<char*>::writeTo(LChar* destination) { | 15 void WTF::StringTypeAdapter<char*>::writeTo(LChar* destination) { |
| 16 for (unsigned i = 0; i < m_length; ++i) | 16 for (unsigned i = 0; i < m_length; ++i) |
| 17 destination[i] = static_cast<LChar>(m_buffer[i]); | 17 destination[i] = static_cast<LChar>(m_buffer[i]); |
| 18 } | 18 } |
| 19 | 19 |
| 20 void WTF::StringTypeAdapter<char*>::writeTo(UChar* destination) { | 20 void WTF::StringTypeAdapter<char*>::writeTo(UChar* destination) { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); | 102 WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void WTF::StringTypeAdapter<StringView>::writeTo(UChar* destination) { | 105 void WTF::StringTypeAdapter<StringView>::writeTo(UChar* destination) { |
| 106 if (is8Bit()) | 106 if (is8Bit()) |
| 107 StringImpl::copyChars(destination, m_view.characters8(), m_view.length()); | 107 StringImpl::copyChars(destination, m_view.characters8(), m_view.length()); |
| 108 else | 108 else |
| 109 StringImpl::copyChars(destination, m_view.characters16(), m_view.length()); | 109 StringImpl::copyChars(destination, m_view.characters16(), m_view.length()); |
| 110 WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); | 110 WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); |
| 111 } | 111 } |
| OLD | NEW |