OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
reserved. |
3 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 17 matching lines...) Expand all Loading... |
28 class StringAppend { | 28 class StringAppend { |
29 public: | 29 public: |
30 StringAppend(StringType1 string1, StringType2 string2) | 30 StringAppend(StringType1 string1, StringType2 string2) |
31 : m_string1(string1) | 31 : m_string1(string1) |
32 , m_string2(string2) | 32 , m_string2(string2) |
33 { | 33 { |
34 } | 34 } |
35 | 35 |
36 operator String() const | 36 operator String() const |
37 { | 37 { |
38 RefPtr<StringImpl> resultImpl = makeString(m_string1, m_string2); | 38 return String(makeString(m_string1, m_string2)); |
39 return resultImpl.release(); | |
40 } | 39 } |
41 | 40 |
42 operator AtomicString() const | 41 operator AtomicString() const |
43 { | 42 { |
44 return operator String(); | 43 return AtomicString(makeString(m_string1, m_string2)); |
45 } | 44 } |
46 | 45 |
47 bool is8Bit() | 46 bool is8Bit() |
48 { | 47 { |
49 StringTypeAdapter<StringType1> adapter1(m_string1); | 48 StringTypeAdapter<StringType1> adapter1(m_string1); |
50 StringTypeAdapter<StringType2> adapter2(m_string2); | 49 StringTypeAdapter<StringType2> adapter2(m_string2); |
51 return adapter1.is8Bit() && adapter2.is8Bit(); | 50 return adapter1.is8Bit() && adapter2.is8Bit(); |
52 } | 51 } |
53 | 52 |
54 void writeTo(LChar* destination) | 53 void writeTo(LChar* destination) |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 138 |
140 template<typename U, typename V, typename W> | 139 template<typename U, typename V, typename W> |
141 StringAppend<StringAppend<U, V>, W> operator+(const StringAppend<U, V>& string1,
W string2) | 140 StringAppend<StringAppend<U, V>, W> operator+(const StringAppend<U, V>& string1,
W string2) |
142 { | 141 { |
143 return StringAppend<StringAppend<U, V>, W>(string1, string2); | 142 return StringAppend<StringAppend<U, V>, W>(string1, string2); |
144 } | 143 } |
145 | 144 |
146 } // namespace WTF | 145 } // namespace WTF |
147 | 146 |
148 #endif // StringOperators_h | 147 #endif // StringOperators_h |
OLD | NEW |