source: vendor/nemo/current/NEMOGCM/EXTERNAL/XIOS/extern/boost/include/boost/range/detail/detail_str.hpp @ 44

Last change on this file since 44 was 44, checked in by cholod, 12 years ago

Load NEMO_TMP into vendor/nemo/current.

File size: 8.5 KB
Line 
1// Boost.Range library
2//
3//  Copyright Thorsten Ottosen 2003-2004. Use, modification and
4//  distribution is subject to the Boost Software License, Version
5//  1.0. (See accompanying file LICENSE_1_0.txt or copy at
6//  http://www.boost.org/LICENSE_1_0.txt)
7//
8// For more information, see http://www.boost.org/libs/range/
9//
10
11#ifndef BOOST_RANGE_DETAIL_DETAIL_STR_HPP
12#define BOOST_RANGE_DETAIL_DETAIL_STR_HPP
13
14#include <boost/config.hpp> // BOOST_MSVC
15#include <boost/range/iterator.hpp>
16
17namespace boost
18{
19   
20    namespace range_detail
21    {
22        //
23        // iterator
24        //
25       
26        template<>
27        struct range_iterator_<char_array_>
28        { 
29            template< typename T >
30            struct pts
31            {
32                 typedef BOOST_RANGE_DEDUCED_TYPENAME
33                    remove_extent<T>::type* type;
34            };
35        };
36
37        template<>
38        struct range_iterator_<char_ptr_>
39        {
40            template< typename S >
41            struct pts
42            {
43                typedef char* type; 
44            };         
45        };
46
47        template<>
48        struct range_iterator_<const_char_ptr_>
49        {
50            template< typename S >
51            struct pts
52            {
53                typedef const char* type;
54            };         
55        };
56
57        template<>
58        struct range_iterator_<wchar_t_ptr_>
59        {
60            template< typename S >
61            struct pts
62            {
63                typedef wchar_t* type; 
64            };         
65        };
66
67        template<>
68        struct range_iterator_<const_wchar_t_ptr_>
69        {
70             template< typename S >
71             struct pts
72             {
73                 typedef const wchar_t* type; 
74             };         
75        };
76
77
78        //
79        // const iterator
80        //
81
82        template<>
83        struct range_const_iterator_<char_array_>
84        { 
85            template< typename T >
86            struct pts
87            {
88                typedef const BOOST_RANGE_DEDUCED_TYPENAME
89                    remove_extent<T>::type* type;
90            };
91        };
92
93        template<>
94        struct range_const_iterator_<char_ptr_>
95        {
96            template< typename S >
97            struct pts
98            {
99                typedef const char* type; 
100            };         
101        };
102
103        template<>
104        struct range_const_iterator_<const_char_ptr_>
105        {
106            template< typename S >
107            struct pts
108            {
109                typedef const char* type; 
110            };         
111        };
112
113        template<>
114        struct range_const_iterator_<wchar_t_ptr_>
115        {
116            template< typename S >
117            struct pts
118            {
119                typedef const wchar_t* type; 
120            };         
121        };
122
123        template<>
124        struct range_const_iterator_<const_wchar_t_ptr_>
125        {
126             template< typename S >
127             struct pts
128             {
129                 typedef const wchar_t* type; 
130             };         
131        };
132    }
133}
134
135#include <boost/range/detail/begin.hpp>
136#include <boost/range/detail/end.hpp>
137#include <boost/range/detail/size_type>
138#include <boost/range/detail/value_type>
139#include <boost/range/detail/common.hpp>
140
141namespace boost
142{
143   
144    namespace range_detail
145    {
146        //
147        // str_begin()
148        //
149        template<>
150        struct range_begin<char_ptr_>
151        {
152            static char* fun( char* s )
153            {
154                return s;
155            }
156        };
157
158        template<>
159        struct range_begin<const_char_ptr_>
160        {
161            static const char* fun( const char* s )
162            {
163                return s;
164            }
165        };
166       
167        template<>
168        struct range_begin<wchar_t_ptr_>
169        {
170           
171            static wchar_t* fun( wchar_t* s )
172            {
173                return s;
174            }
175        };
176
177        template<>
178        struct range_begin<const_wchar_t_ptr_>
179        {
180            static const wchar_t* fun( const wchar_t* s )
181            {
182                return s;
183            }
184        };
185       
186        template< typename C >
187        inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type
188        str_begin( C& c )
189        {
190            return range_detail::range_begin< BOOST_RANGE_DEDUCED_TYPENAME
191                range_detail::range<C>::type >::fun( c );
192        }
193
194        //
195        // str_end()
196        //
197
198        template<>
199        struct range_end<char_array_>
200        {
201            template< typename T, std::size_t sz >
202            static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
203            {
204                return boost::range_detail::array_end( boost_range_array );
205            }
206        };
207       
208        template<>
209        struct range_end<wchar_t_array_>
210        {
211            template< typename T, std::size_t sz >
212            static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
213            {
214                return boost::range_detail::array_end( boost_range_array );
215            }
216        };
217       
218        template<>
219        struct range_end<char_ptr_>
220        {
221            static char* fun( char* s )
222            {
223                return boost::range_detail::str_end( s );
224            }
225        };
226
227        template<>
228        struct range_end<const_char_ptr_>
229        {
230            static const char* fun( const char* s )
231            {
232                return boost::range_detail::str_end( s );
233            }
234        };
235
236        template<>
237        struct range_end<wchar_t_ptr_>
238        {
239            static wchar_t* fun( wchar_t* s )
240            {
241                return boost::range_detail::str_end( s );
242            }
243        };
244
245
246        template<>
247        struct range_end<const_wchar_t_ptr_>
248        {
249            static const wchar_t* fun( const wchar_t* s )
250            {
251                return boost::range_detail::str_end( s );
252            }
253        };
254
255        template< typename C >
256        inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type
257        str_end( C& c )
258        {
259            return range_detail::range_end< BOOST_RANGE_DEDUCED_TYPENAME
260                range_detail::range<C>::type >::fun( c );
261        }
262
263        //
264        // size_type
265        //
266
267        template<>
268        struct range_size_type_<char_array_>
269        { 
270            template< typename A >
271            struct pts
272            {
273                typedef std::size_t type;
274            };
275        };
276
277        template<>
278        struct range_size_type_<char_ptr_>
279        {
280            template< typename S >
281            struct pts
282            {
283                typedef std::size_t type;
284            };         
285        };
286       
287        template<>
288        struct range_size_type_<const_char_ptr_>
289        {
290            template< typename S >
291            struct pts
292            {
293                typedef std::size_t type;
294            };         
295        };
296       
297        template<>
298        struct range_size_type_<wchar_t_ptr_>
299        {
300            template< typename S >
301            struct pts
302            {
303                typedef std::size_t type;
304            };         
305        };
306       
307        template<>
308        struct range_size_type_<const_wchar_t_ptr_>
309        {
310            template< typename S >
311            struct pts
312            {
313                typedef std::size_t type;
314            };         
315        }; 
316
317        //
318        // value_type
319        //
320       
321        template<>
322        struct range_value_type_<char_array_>
323        { 
324            template< typename T >
325            struct pts
326            {
327                typedef char type;
328            };
329        };
330
331        template<>
332        struct range_value_type_<char_ptr_>
333        {
334             template< typename S >
335             struct pts
336             {
337                 typedef char type; 
338             };         
339        };
340       
341        template<>
342        struct range_value_type_<const_char_ptr_>
343        {
344             template< typename S >
345             struct pts
346             {
347                 typedef const char type;
348             };         
349        };
350       
351        template<>
352        struct range_value_type_<wchar_t_ptr_>
353        {
354             template< typename S >
355             struct pts
356             {
357                 typedef wchar_t type;
358             };         
359        };
360       
361        template<>
362        struct range_value_type_<const_wchar_t_ptr_>
363        {
364            template< typename S >
365            struct pts
366            {
367                typedef const wchar_t type;
368            };         
369        };
370
371    } // namespace 'range_detail'
372
373} // namespace 'boost'
374
375
376#endif
Note: See TracBrowser for help on using the repository browser.