OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2012 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com> | 3 * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com> |
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 26 matching lines...) Expand all Loading... |
37 template<> struct ConversionTrait<String> { | 37 template<> struct ConversionTrait<String> { |
38 typedef PassRefPtr<StringImpl> ReturnType; | 38 typedef PassRefPtr<StringImpl> ReturnType; |
39 typedef void AdditionalArgumentType; | 39 typedef void AdditionalArgumentType; |
40 static inline ReturnType flush(LChar* characters, unsigned length, void*) {
return StringImpl::create(characters, length); } | 40 static inline ReturnType flush(LChar* characters, unsigned length, void*) {
return StringImpl::create(characters, length); } |
41 }; | 41 }; |
42 template<> struct ConversionTrait<StringBuilder> { | 42 template<> struct ConversionTrait<StringBuilder> { |
43 typedef void ReturnType; | 43 typedef void ReturnType; |
44 typedef StringBuilder AdditionalArgumentType; | 44 typedef StringBuilder AdditionalArgumentType; |
45 static inline ReturnType flush(LChar* characters, unsigned length, StringBui
lder* stringBuilder) { stringBuilder->append(characters, length); } | 45 static inline ReturnType flush(LChar* characters, unsigned length, StringBui
lder* stringBuilder) { stringBuilder->append(characters, length); } |
46 }; | 46 }; |
| 47 template<> struct ConversionTrait<AtomicString> { |
| 48 typedef AtomicString ReturnType; |
| 49 typedef void AdditionalArgumentType; |
| 50 static inline ReturnType flush(LChar* characters, unsigned length, void*) {
return AtomicString(characters, length); } |
| 51 }; |
47 | 52 |
48 template<typename T> struct UnsignedIntegerTrait; | 53 template<typename T> struct UnsignedIntegerTrait; |
49 | 54 |
50 template<> struct UnsignedIntegerTrait<int> { | 55 template<> struct UnsignedIntegerTrait<int> { |
51 typedef unsigned int Type; | 56 typedef unsigned int Type; |
52 }; | 57 }; |
53 template<> struct UnsignedIntegerTrait<long> { | 58 template<> struct UnsignedIntegerTrait<long> { |
54 typedef unsigned long Type; | 59 typedef unsigned long Type; |
55 }; | 60 }; |
56 template<> struct UnsignedIntegerTrait<long long> { | 61 template<> struct UnsignedIntegerTrait<long long> { |
(...skipping 28 matching lines...) Expand all Loading... |
85 | 90 |
86 template<typename T, typename UnsignedIntegerType> | 91 template<typename T, typename UnsignedIntegerType> |
87 inline typename ConversionTrait<T>::ReturnType numberToStringUnsigned(UnsignedIn
tegerType number, typename ConversionTrait<T>::AdditionalArgumentType* additiona
lArgument = 0) | 92 inline typename ConversionTrait<T>::ReturnType numberToStringUnsigned(UnsignedIn
tegerType number, typename ConversionTrait<T>::AdditionalArgumentType* additiona
lArgument = 0) |
88 { | 93 { |
89 return numberToStringImpl<T, UnsignedIntegerType, PositiveNumber>(number, ad
ditionalArgument); | 94 return numberToStringImpl<T, UnsignedIntegerType, PositiveNumber>(number, ad
ditionalArgument); |
90 } | 95 } |
91 | 96 |
92 } // namespace WTF | 97 } // namespace WTF |
93 | 98 |
94 #endif // IntegerToStringConversion_h | 99 #endif // IntegerToStringConversion_h |
OLD | NEW |