|
Go to the documentation of this file.
20 #ifndef ADOBE_DICTIONARY_ARG_STREAM_HPP
21 #define ADOBE_DICTIONARY_ARG_STREAM_HPP
28 #include <boost/range/begin.hpp>
29 #include <boost/range/end.hpp>
30 #include <boost/range/value_type.hpp>
31 #include <boost/array.hpp>
32 #include <boost/utility/value_init.hpp>
66 template < typename Dictionary, typename InputRange , typename NoThrow = void >
71 typedef typename boost::range_iterator<InputRange const>::type iterator;
114 template < typename Dictionary, typename InputRange , typename NoThrow = void >
136 template < typename R>
142 return get_dictionary_entry<R>( dict, * curr++);
145 template < typename Dictionary, typename InputRange >
154 template < typename R>
159 R r = boost::initialized_value;
166 template < typename Dictionary, typename InputRange >
167 dictionary_arg_stream<Dictionary, InputRange, void>
169 Dictionary & dict, InputRange const & key_range)
174 template < typename Dictionary, typename InputRange >
175 dictionary_arg_stream<Dictionary, InputRange, std::nothrow_t>
177 Dictionary & dict, InputRange const & key_range, std::nothrow_t)
183 namespace dictionary_arg_stream_detail
191 template < typename R>
194 template < typename Dictionary, typename Key>
203 template < typename Dictionary, typename Key, typename R>
214 template < typename Dictionary, typename Range>
224 template < typename Dictionary, typename DefaultKey, bool has_type = ADOBE_HAS_TYPE(Dictionary, key_type)>
227 template < typename Dictionary, typename DefaultKey>
228 struct key_type<Dictionary, DefaultKey, false>
232 template < typename Dictionary, typename DefaultKey>
233 struct key_type<Dictionary, DefaultKey, true>
235 typedef typename Dictionary::key_type type;
242 template < typename NoThrow = std::nothrow_t, bool isRange = true>
245 template < typename F, typename Dictionary, typename InputRange>
247 call(F f, Dictionary const & dict, InputRange const & range)
255 template < typename F, typename Dictionary, typename InputRange>
257 call(F f, Dictionary const & dict, InputRange const & range)
266 template < typename F, typename Dictionary, typename Key>
268 call(F f, Dictionary const & dict, Key const & keyable)
270 typedef typename key_type<Dictionary, Key>::type key_type;
271 key_type key(keyable);
272 std::pair<key_type const *, key_type const *> key_range(&key, &key + 1);
279 template < typename F, typename Dictionary, typename Key>
281 call(F f, Dictionary const & dict, Key const & keyable)
283 typedef typename key_type<Dictionary, Key>::type key_type;
284 key_type key(keyable);
285 std::pair<key_type const *, key_type const *> key_range(&key, &key + 1);
290 template < typename NoThrow, typename Dictionary, typename T>
292 : if_range_base<NoThrow, is_range_for_dictionary<Dictionary, T>::value>
303 template < typename F, typename Dictionary, typename SingleArg>
311 template < typename F, typename Dictionary, typename SingleArg>
312 typename arg_stream::result_type<F>::type
319 template < class T, typename F, typename Dictionary, typename SingleArg>
320 typename arg_stream::result_type<F>::type
326 template < class T, typename F, typename Dictionary, typename SingleArg>
327 typename arg_stream::result_type<F>::type
335 template < typename F, typename Dictionary, typename T1, typename T2 >
336 typename arg_stream::result_type<F>::type
338 T1 const & key1, T2 const & key2)
340 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
341 boost::array<key_type, 2> arr = { key_type(key1), key_type(key2) };
345 template < typename X, typename F, typename Dictionary, typename T1, typename T2 >
346 typename arg_stream::result_type<F>::type
348 T1 const & key1, T2 const & key2)
350 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
351 boost::array<key_type, 2> arr = { key_type(key1), key_type(key2) };
355 template < typename F, typename Dictionary, typename T1, typename T2 >
356 typename arg_stream::result_type<F>::type
358 T1 const & key1, T2 const & key2)
360 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
361 boost::array<key_type, 2> arr = { key_type(key1), key_type(key2) };
365 template < typename X, typename F, typename Dictionary, typename T1, typename T2 >
366 typename arg_stream::result_type<F>::type
368 T1 const & key1, T2 const & key2)
370 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
371 boost::array<key_type, 2> arr = { key_type(key1), key_type(key2) };
376 template < typename F, typename Dictionary, typename T1, typename T2, typename T3>
377 typename arg_stream::result_type<F>::type
379 T1 const & key1, T2 const & key2, T3 const & key3)
381 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
382 boost::array<key_type, 3> arr = { key_type(key1), key_type(key2), key_type(key3) };
386 template < typename X, typename F, typename Dictionary, typename T1, typename T2, typename T3>
387 typename arg_stream::result_type<F>::type
389 T1 const & key1, T2 const & key2, T3 const & key3)
391 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
392 boost::array<key_type, 3> arr = { key_type(key1), key_type(key2), key_type(key3) };
396 template < typename F, typename Dictionary, typename T1, typename T2, typename T3>
397 typename arg_stream::result_type<F>::type
399 T1 const & key1, T2 const & key2, T3 const & key3)
401 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
402 boost::array<key_type, 3> arr = { key_type(key1), key_type(key2), key_type(key3) };
406 template < typename X, typename F, typename Dictionary, typename T1, typename T2, typename T3>
407 typename arg_stream::result_type<F>::type
409 T1 const & key1, T2 const & key2, T3 const & key3)
411 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
412 boost::array<key_type, 3> arr = { key_type(key1), key_type(key2), key_type(key3) };
417 template < typename F, typename Dictionary, typename T1, typename T2, typename T3, typename T4>
418 typename arg_stream::result_type<F>::type
420 T1 const & key1, T2 const & key2, T3 const & key3, T4 const & key4)
422 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
423 boost::array<key_type, 4> arr = { key_type(key1), key_type(key2), key_type(key3), key_type(key4) };
427 template < typename X, typename F, typename Dictionary, typename T1, typename T2, typename T3, typename T4>
428 typename arg_stream::result_type<F>::type
430 T1 const & key1, T2 const & key2, T3 const & key3, T4 const & key4)
432 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
433 boost::array<key_type, 4> arr = { key_type(key1), key_type(key2), key_type(key3), key_type(key4) };
437 template < typename F, typename Dictionary, typename T1, typename T2, typename T3, typename T4>
438 typename arg_stream::result_type<F>::type
440 T1 const & key1, T2 const & key2, T3 const & key3, T4 const & key4)
442 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
443 boost::array<key_type, 4> arr = { key_type(key1), key_type(key2), key_type(key3), key_type(key4) };
447 template < typename X, typename F, typename Dictionary, typename T1, typename T2, typename T3, typename T4>
448 typename arg_stream::result_type<F>::type
450 T1 const & key1, T2 const & key2, T3 const & key3, T4 const & key4)
452 typedef typename dictionary_arg_stream_detail::key_type<Dictionary, T1>::type key_type;
453 boost::array<key_type, 4> arr = { key_type(key1), key_type(key2), key_type(key3), key_type(key4) };
460 #endif // include guard
|