OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 void writeTo(LChar* destination); | 205 void writeTo(LChar* destination); |
206 | 206 |
207 void writeTo(UChar* destination); | 207 void writeTo(UChar* destination); |
208 | 208 |
209 private: | 209 private: |
210 const LChar* m_buffer; | 210 const LChar* m_buffer; |
211 unsigned m_length; | 211 unsigned m_length; |
212 }; | 212 }; |
213 | 213 |
214 template<> | 214 template<> |
215 class WTF_EXPORT StringTypeAdapter<Vector<char> > { | 215 class WTF_EXPORT StringTypeAdapter<Vector<char>> { |
216 public: | 216 public: |
217 StringTypeAdapter<Vector<char> >(const Vector<char>& buffer) | 217 StringTypeAdapter<Vector<char>>(const Vector<char>& buffer) |
218 : m_buffer(buffer) | 218 : m_buffer(buffer) |
219 { | 219 { |
220 } | 220 } |
221 | 221 |
222 size_t length() { return m_buffer.size(); } | 222 size_t length() { return m_buffer.size(); } |
223 | 223 |
224 bool is8Bit() { return true; } | 224 bool is8Bit() { return true; } |
225 | 225 |
226 void writeTo(LChar* destination); | 226 void writeTo(LChar* destination); |
227 | 227 |
228 void writeTo(UChar* destination); | 228 void writeTo(UChar* destination); |
229 | 229 |
230 private: | 230 private: |
231 const Vector<char>& m_buffer; | 231 const Vector<char>& m_buffer; |
232 }; | 232 }; |
233 | 233 |
234 template<> | 234 template<> |
235 class StringTypeAdapter<Vector<LChar> > { | 235 class StringTypeAdapter<Vector<LChar>> { |
236 public: | 236 public: |
237 StringTypeAdapter<Vector<LChar> >(const Vector<LChar>& buffer) | 237 StringTypeAdapter<Vector<LChar>>(const Vector<LChar>& buffer) |
238 : m_buffer(buffer) | 238 : m_buffer(buffer) |
239 { | 239 { |
240 } | 240 } |
241 | 241 |
242 size_t length() { return m_buffer.size(); } | 242 size_t length() { return m_buffer.size(); } |
243 | 243 |
244 bool is8Bit() { return true; } | 244 bool is8Bit() { return true; } |
245 | 245 |
246 void writeTo(LChar* destination); | 246 void writeTo(LChar* destination); |
247 | 247 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 result += adapter1.length(); | 334 result += adapter1.length(); |
335 adapter2.writeTo(result); | 335 adapter2.writeTo(result); |
336 | 336 |
337 return resultImpl.release(); | 337 return resultImpl.release(); |
338 } | 338 } |
339 | 339 |
340 } // namespace WTF | 340 } // namespace WTF |
341 | 341 |
342 #include "wtf/text/StringOperators.h" | 342 #include "wtf/text/StringOperators.h" |
343 #endif | 343 #endif |
OLD | NEW |