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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 }; | 46 }; |
47 template<> struct ConversionTrait<AtomicString> { | 47 template<> struct ConversionTrait<AtomicString> { |
48 typedef AtomicString ReturnType; | 48 typedef AtomicString ReturnType; |
49 typedef void AdditionalArgumentType; | 49 typedef void AdditionalArgumentType; |
50 static inline ReturnType flush(LChar* characters, unsigned length, void*) {
return AtomicString(characters, length); } | 50 static inline ReturnType flush(LChar* characters, unsigned length, void*) {
return AtomicString(characters, length); } |
51 }; | 51 }; |
52 | 52 |
53 template<typename T> struct UnsignedIntegerTrait; | 53 template<typename T> struct UnsignedIntegerTrait; |
54 | 54 |
55 template<> struct UnsignedIntegerTrait<int> { | 55 template<> struct UnsignedIntegerTrait<int> { |
56 typedef unsigned int Type; | 56 typedef unsigned Type; |
57 }; | 57 }; |
58 template<> struct UnsignedIntegerTrait<long> { | 58 template<> struct UnsignedIntegerTrait<long> { |
59 typedef unsigned long Type; | 59 typedef unsigned long Type; |
60 }; | 60 }; |
61 template<> struct UnsignedIntegerTrait<long long> { | 61 template<> struct UnsignedIntegerTrait<long long> { |
62 typedef unsigned long long Type; | 62 typedef unsigned long long Type; |
63 }; | 63 }; |
64 | 64 |
65 template<typename T, typename UnsignedIntegerType, PositiveOrNegativeNumber Numb
erType> | 65 template<typename T, typename UnsignedIntegerType, PositiveOrNegativeNumber Numb
erType> |
66 static typename ConversionTrait<T>::ReturnType numberToStringImpl(UnsignedIntege
rType number, typename ConversionTrait<T>::AdditionalArgumentType* additionalArg
ument) | 66 static typename ConversionTrait<T>::ReturnType numberToStringImpl(UnsignedIntege
rType number, typename ConversionTrait<T>::AdditionalArgumentType* additionalArg
ument) |
(...skipping 23 matching lines...) Expand all Loading... |
90 | 90 |
91 template<typename T, typename UnsignedIntegerType> | 91 template<typename T, typename UnsignedIntegerType> |
92 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) |
93 { | 93 { |
94 return numberToStringImpl<T, UnsignedIntegerType, PositiveNumber>(number, ad
ditionalArgument); | 94 return numberToStringImpl<T, UnsignedIntegerType, PositiveNumber>(number, ad
ditionalArgument); |
95 } | 95 } |
96 | 96 |
97 } // namespace WTF | 97 } // namespace WTF |
98 | 98 |
99 #endif // IntegerToStringConversion_h | 99 #endif // IntegerToStringConversion_h |
OLD | NEW |