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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 StringTypeAdapter<StringType2> adapter2(m_string2); | 67 StringTypeAdapter<StringType2> adapter2(m_string2); |
68 adapter1.writeTo(destination); | 68 adapter1.writeTo(destination); |
69 adapter2.writeTo(destination + adapter1.length()); | 69 adapter2.writeTo(destination + adapter1.length()); |
70 } | 70 } |
71 | 71 |
72 unsigned length() | 72 unsigned length() |
73 { | 73 { |
74 StringTypeAdapter<StringType1> adapter1(m_string1); | 74 StringTypeAdapter<StringType1> adapter1(m_string1); |
75 StringTypeAdapter<StringType2> adapter2(m_string2); | 75 StringTypeAdapter<StringType2> adapter2(m_string2); |
76 return adapter1.length() + adapter2.length(); | 76 return adapter1.length() + adapter2.length(); |
77 } | 77 } |
78 | 78 |
79 private: | 79 private: |
80 StringType1 m_string1; | 80 StringType1 m_string1; |
81 StringType2 m_string2; | 81 StringType2 m_string2; |
82 }; | 82 }; |
83 | 83 |
84 template<typename StringType1, typename StringType2> | 84 template<typename StringType1, typename StringType2> |
85 class StringTypeAdapter<StringAppend<StringType1, StringType2> > { | 85 class StringTypeAdapter<StringAppend<StringType1, StringType2> > { |
86 public: | 86 public: |
87 StringTypeAdapter<StringAppend<StringType1, StringType2> >(StringAppend<Stri
ngType1, StringType2>& buffer) | 87 StringTypeAdapter<StringAppend<StringType1, StringType2> >(StringAppend<Stri
ngType1, StringType2>& buffer) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 template<typename U, typename V, typename W> | 157 template<typename U, typename V, typename W> |
158 StringAppend<StringAppend<U, V>, W> operator+(const StringAppend<U, V>& string1,
W string2) | 158 StringAppend<StringAppend<U, V>, W> operator+(const StringAppend<U, V>& string1,
W string2) |
159 { | 159 { |
160 return StringAppend<StringAppend<U, V>, W>(string1, string2); | 160 return StringAppend<StringAppend<U, V>, W>(string1, string2); |
161 } | 161 } |
162 | 162 |
163 } // namespace WTF | 163 } // namespace WTF |
164 | 164 |
165 #endif // StringOperators_h | 165 #endif // StringOperators_h |
OLD | NEW |