16#ifndef RWrap_libcpp_string_view_h
17#define RWrap_libcpp_string_view_h
20#error "Do not use RWrap_libcpp_string_view.h directly. #include \"ROOT/RStringView.hxx\" instead."
49#define _ROOT_LIBCPP_BEGIN_NAMESPACE_LFTS \
51namespace experimental { inline namespace __ROOT {
52#define _ROOT_LIBCPP_END_NAMESPACE_LFTS } } }
56#define _ROOT_LIBCPP_BEGIN_NAMESPACE_LFTS \
58namespace experimental { namespace __ROOT {
59#define _ROOT_LIBCPP_END_NAMESPACE_LFTS } using namespace __ROOT; } }
64#ifndef _LIBCPP_BEGIN_NAMESPACE_STD
65#define _LOCAL_LIBCPP_BEGIN_NAMESPACE_STD
66#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {
67#define _LIBCPP_END_NAMESPACE_STD }
70#ifndef _LIBCPP_CONSTEXPR
71#define _LOCAL_LIBCPP_CONSTEXPR
72#define _LIBCPP_CONSTEXPR constexpr
80#ifndef _LIBCPP_INLINE_VISIBILITY
81#define _LOCAL_LIBCPP_INLINE_VISIBILITY
82#define _LIBCPP_INLINE_VISIBILITY inline
85#ifndef _LIBCPP_EXPLICIT
86#define _LOCAL_LIBCPP_EXPLICIT
87#define _LIBCPP_EXPLICIT explicit
96#define _LOCAL_LIBCPP_STD_VER
97#define _LIBCPP_STD_VER 11
100#ifndef _LIBCPP_TYPE_VIS_ONLY
101#define _LOCAL_LIBCPP_TYPE_VIS_ONLY
102#define _LIBCPP_TYPE_VIS_ONLY
105#ifndef _LIBCPP_CONSTEXPR_AFTER_CXX11
106#define _LOCAL_LIBCPP_CONSTEXPR_AFTER_CXX11
107#define _LIBCPP_CONSTEXPR_AFTER_CXX11
111#define _LOCAL_NOEXCEPT
115#ifndef _LIBCPP_ASSERT
116#define _LOCAL_LIBCPP_ASSERT
117#define _LIBCPP_ASSERT(X,Y) ((void)0)
127inline namespace __ROOT {
130inline namespace __1 {
141 template <
class _CharT,
class _OutputIterator>
143 __pad_and_output(_OutputIterator __s,
144 const _CharT* __ob,
const _CharT* __op,
const _CharT* __oe,
145 ios_base& __iob, _CharT __fl)
147 streamsize __sz = __oe - __ob;
148 streamsize __ns = __iob.width();
153 for (;__ob < __op; ++__ob, ++__s)
155 for (; __ns; --__ns, ++__s)
157 for (; __ob < __oe; ++__ob, ++__s)
163 template<
class _CharT,
class _Traits>
164 basic_ostream<_CharT, _Traits>&
165 R__put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
166 const _CharT* __str,
size_t __len)
173 typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
176 typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
177 if (__pad_and_output(_Ip(__os),
179 (__os.flags() & ios_base::adjustfield) == ios_base::left ?
184 __os.fill()).failed())
185 __os.setstate(ios_base::badbit | ios_base::failbit);
192 __os.__set_badbit_and_consider_rethrow();
201 template <
class _BinaryPredicate,
class _ForwardIterator1,
class _ForwardIterator2>
203 __search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
204 _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,
205 forward_iterator_tag, forward_iterator_tag)
207 if (__first2 == __last2)
214 if (__first1 == __last1)
216 if (__pred(*__first1, *__first2))
221 _ForwardIterator1 __m1 = __first1;
222 _ForwardIterator2 __m2 = __first2;
225 if (++__m2 == __last2)
227 if (++__m1 == __last1)
229 if (!__pred(*__m1, *__m2))
238 template <
class _BinaryPredicate,
class _RandomAccessIterator1,
class _RandomAccessIterator2>
240 __search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
241 _RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
242 random_access_iterator_tag, random_access_iterator_tag)
244 typedef typename std::iterator_traits<_RandomAccessIterator1>::difference_type _D1;
245 typedef typename std::iterator_traits<_RandomAccessIterator2>::difference_type _D2;
247 _D2 __len2 = __last2 - __first2;
250 _D1 __len1 = __last1 - __first1;
253 const _RandomAccessIterator1 __s = __last1 - (__len2 - 1);
256#if !_LIBCPP_UNROLL_LOOPS
261 if (__pred(*__first1, *__first2))
266 for (_D1 __loop_unroll = (__s - __first1) / 4; __loop_unroll > 0; --__loop_unroll)
268 if (__pred(*__first1, *__first2))
270 if (__pred(*++__first1, *__first2))
272 if (__pred(*++__first1, *__first2))
274 if (__pred(*++__first1, *__first2))
278 switch (__s - __first1)
281 if (__pred(*__first1, *__first2))
285 if (__pred(*__first1, *__first2))
289 if (__pred(*__first1, *__first2))
296 _RandomAccessIterator1 __m1 = __first1;
297 _RandomAccessIterator2 __m2 = __first2;
298#if !_LIBCPP_UNROLL_LOOPS
301 if (++__m2 == __last2)
304 if (!__pred(*__m1, *__m2))
313 for (_D2 __loop_unroll = (__last2 - __m2) / 4; __loop_unroll > 0; --__loop_unroll)
315 if (!__pred(*__m1, *__m2))
317 if (!__pred(*++__m1, *++__m2))
319 if (!__pred(*++__m1, *++__m2))
321 if (!__pred(*++__m1, *++__m2))
326 switch (__last2 - __m2)
329 if (!__pred(*__m1, *__m2))
334 if (!__pred(*__m1, *__m2))
339 if (!__pred(*__m1, *__m2))
352 template <
class _ForwardIterator1,
class _ForwardIterator2,
class _BinaryPredicate>
354 __find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
355 _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
357 for (; __first1 != __last1; ++__first1)
358 for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
359 if (__pred(*__first1, *__j))
365 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
367 __str_find(
const _CharT *__p, _SizeT __sz,
372 const _CharT* __r = _Traits::find(__p + __pos, __sz - __pos, __c);
375 return static_cast<_SizeT
>(__r - __p);
378 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
380 __str_find(
const _CharT *__p, _SizeT __sz,
381 const _CharT* __s, _SizeT __pos, _SizeT __n)
383 if (__pos > __sz || __sz - __pos < __n)
388 _VSTD::__search(__p + __pos, __p + __sz,
389 __s, __s + __n, _Traits::eq,
390 random_access_iterator_tag(), random_access_iterator_tag());
391 if (__r == __p + __sz)
393 return static_cast<_SizeT
>(__r - __p);
399 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
401 __str_rfind(
const _CharT *__p, _SizeT __sz,
402 _CharT __c, _SizeT __pos)
410 for (
const _CharT* __ps = __p + __pos; __ps != __p;)
412 if (_Traits::eq(*--__ps, __c))
413 return static_cast<_SizeT
>(__ps - __p);
418 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
420 __str_rfind(
const _CharT *__p, _SizeT __sz,
421 const _CharT* __s, _SizeT __pos, _SizeT __n)
423 __pos = _VSTD::min(__pos, __sz);
424 if (__n < __sz - __pos)
428 const _CharT* __r = _VSTD::__find_end(
429 __p, __p + __pos, __s, __s + __n, _Traits::eq,
430 random_access_iterator_tag(), random_access_iterator_tag());
431 if (__n > 0 && __r == __p + __pos)
433 return static_cast<_SizeT
>(__r - __p);
437 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
439 __str_find_first_of(
const _CharT *__p, _SizeT __sz,
440 const _CharT* __s, _SizeT __pos, _SizeT __n)
442 if (__pos >= __sz || __n == 0)
444 const _CharT* __r = _VSTD::__find_first_of_ce
445 (__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq );
446 if (__r == __p + __sz)
448 return static_cast<_SizeT
>(__r - __p);
453 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
455 __str_find_last_of(
const _CharT *__p, _SizeT __sz,
456 const _CharT* __s, _SizeT __pos, _SizeT __n)
464 for (
const _CharT* __ps = __p + __pos; __ps != __p;)
466 const _CharT* __r = _Traits::find(__s, __n, *--__ps);
468 return static_cast<_SizeT
>(__ps - __p);
476 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
478 __str_find_first_not_of(
const _CharT *__p, _SizeT __sz,
479 const _CharT* __s, _SizeT __pos, _SizeT __n)
483 const _CharT* __pe = __p + __sz;
484 for (
const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
485 if (_Traits::find(__s, __n, *__ps) == 0)
486 return static_cast<_SizeT
>(__ps - __p);
492 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
494 __str_find_first_not_of(
const _CharT *__p, _SizeT __sz,
495 _CharT __c, _SizeT __pos)
499 const _CharT* __pe = __p + __sz;
500 for (
const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
501 if (!_Traits::eq(*__ps, __c))
502 return static_cast<_SizeT
>(__ps - __p);
509 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
511 __str_find_last_not_of(
const _CharT *__p, _SizeT __sz,
512 const _CharT* __s, _SizeT __pos, _SizeT __n)
518 for (
const _CharT* __ps = __p + __pos; __ps != __p;)
519 if (_Traits::find(__s, __n, *--__ps) == 0)
520 return static_cast<_SizeT
>(__ps - __p);
525 template<
class _CharT,
class _SizeT,
class _Traits, _SizeT __npos>
527 __str_find_last_not_of(
const _CharT *__p, _SizeT __sz,
528 _CharT __c, _SizeT __pos)
534 for (
const _CharT* __ps = __p + __pos; __ps != __p;)
535 if (!_Traits::eq(*--__ps, __c))
536 return static_cast<_SizeT
>(__ps - __p);
549#ifdef _LOCAL_LIBCPP_BEGIN_NAMESPACE_LFTS
550#undef _LIBCPP_BEGIN_NAMESPACE_LFTS
551#undef _LIBCPP_END_NAMESPACE_LFTS
554#ifdef _LOCAL_LIBCPP_BEGIN_NAMESPACE_STD
555#undef _LIBCPP_BEGIN_NAMESPACE_STD
556#undef _LIBCPP_END_NAMESPACE_STD
559#ifdef _LOCAL_LIBCPP_CONSTEXPR
560#undef _LIBCPP_CONSTEXPR
567#ifdef _LOCAL_LIBCPP_INLINE_VISIBILITY
568#undef _LIBCPP_INLINE_VISIBILITY
571#ifdef _LOCAL_LIBCPP_STD_VER
572#undef _LIBCPP_STD_VER
575#ifdef _LOCAL_LIBCPP_TYPE_VIS_ONLY
576#undef _LIBCPP_TYPE_VIS_ONLY
579#ifdef _LOCAL_LIBCPP_CONSTEXPR_AFTER_CXX11
580#undef _LIBCPP_CONSTEXPR_AFTER_CXX11
583#ifdef _LOCAL_NOEXCEPT
587#ifdef _LOCAL_LIBCPP_ASSERT
#define _LIBCPP_INLINE_VISIBILITY
#define _LIBCPP_CONSTEXPR_AFTER_CXX11