OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 bool getKey(const String& key, v8::Local<v8::Value>&) const; | 125 bool getKey(const String& key, v8::Local<v8::Value>&) const; |
126 | 126 |
127 private: | 127 private: |
128 v8::Handle<v8::Value> m_options; | 128 v8::Handle<v8::Value> m_options; |
129 v8::Isolate* m_isolate; | 129 v8::Isolate* m_isolate; |
130 ExceptionState* m_exceptionState; | 130 ExceptionState* m_exceptionState; |
131 }; | 131 }; |
132 | 132 |
133 template<> | 133 template<> |
134 struct NativeValueTraits<Dictionary> { | 134 struct NativeValueTraits<Dictionary> { |
135 static inline Dictionary nativeValue(const v8::Handle<v8::Value>& value, v8:
:Isolate* isolate, ExceptionState& exceptionState) | 135 static inline Dictionary nativeValue(v8::Handle<v8::Value> value, v8::Isolat
e* isolate, ExceptionState& exceptionState) |
136 { | 136 { |
137 return Dictionary(value, isolate, exceptionState); | 137 return Dictionary(value, isolate, exceptionState); |
138 } | 138 } |
139 }; | 139 }; |
140 | 140 |
141 // DictionaryHelper is a collection of static methods for getting or | 141 // DictionaryHelper is a collection of static methods for getting or |
142 // converting a value from Dictionary. | 142 // converting a value from Dictionary. |
143 struct DictionaryHelper { | 143 struct DictionaryHelper { |
144 template <typename T> | 144 template <typename T> |
145 static bool get(const Dictionary&, const String& key, T& value); | 145 static bool get(const Dictionary&, const String& key, T& value); |
(...skipping 15 matching lines...) Expand all Loading... |
161 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const
String& key, T& value); | 161 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const
String& key, T& value); |
162 template <typename T> | 162 template <typename T> |
163 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const
String& key, Nullable<T>& value); | 163 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const
String& key, Nullable<T>& value); |
164 template <template <typename> class PointerType, typename T> | 164 template <template <typename> class PointerType, typename T> |
165 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const
String& key, PointerType<T>& value); | 165 static bool convert(const Dictionary&, Dictionary::ConversionContext&, const
String& key, PointerType<T>& value); |
166 }; | 166 }; |
167 | 167 |
168 } | 168 } |
169 | 169 |
170 #endif // Dictionary_h | 170 #endif // Dictionary_h |
OLD | NEW |