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 "platform/wtf/text/StringConcatenate.h" |
8 | 8 |
9 #include "wtf/text/StringImpl.h" | 9 #include "platform/wtf/text/StringImpl.h" |
10 | 10 |
11 // This macro is helpful for testing how many intermediate Strings are created | 11 // This macro is helpful for testing how many intermediate Strings are created |
12 // while evaluating an expression containing operator+. | 12 // while evaluating an expression containing operator+. |
13 #ifndef WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING | 13 #ifndef WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING |
14 #define WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING() ((void)0) | 14 #define WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING() ((void)0) |
15 #endif | 15 #endif |
16 | 16 |
17 void WTF::StringTypeAdapter<char*>::writeTo(LChar* destination) const { | 17 void WTF::StringTypeAdapter<char*>::writeTo(LChar* destination) const { |
18 for (unsigned i = 0; i < m_length; ++i) | 18 for (unsigned i = 0; i < m_length; ++i) |
19 destination[i] = static_cast<LChar>(m_buffer[i]); | 19 destination[i] = static_cast<LChar>(m_buffer[i]); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); | 76 WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); |
77 } | 77 } |
78 | 78 |
79 void WTF::StringTypeAdapter<StringView>::writeTo(UChar* destination) const { | 79 void WTF::StringTypeAdapter<StringView>::writeTo(UChar* destination) const { |
80 if (is8Bit()) | 80 if (is8Bit()) |
81 StringImpl::copyChars(destination, m_view.characters8(), m_view.length()); | 81 StringImpl::copyChars(destination, m_view.characters8(), m_view.length()); |
82 else | 82 else |
83 StringImpl::copyChars(destination, m_view.characters16(), m_view.length()); | 83 StringImpl::copyChars(destination, m_view.characters16(), m_view.length()); |
84 WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); | 84 WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING(); |
85 } | 85 } |
OLD | NEW |