38template <
class _CharT,
class _InputIter>
39_InputIter __rw_match_name (_InputIter __it, _InputIter __end,
40 const _CharT*
const *__names,
41 const _RWSTD_SIZE_T *__sizes,
42 _RWSTD_SIZE_T __count,
45 _STD::ios_base *__flags)
47 const _RWSTD_SIZE_T __badval = _RWSTD_SIZE_MAX;
50 _RWSTD_ASSERT (__count <=
sizeof (_RWSTD_SIZE_T) * _RWSTD_CHAR_BIT);
53 const _RWSTD_SIZE_T __matchmax = (_RWSTD_SIZE_T)__err;
57 _RWSTD_SIZE_T __bits = ~0UL;
58 _RWSTD_SIZE_T __nmatch = __count;
59 _RWSTD_SIZE_T __pos = 0;
60 _RWSTD_SIZE_T __num = __inx;
64 const _STD::ctype<_CharT> *__ctp = __flags ?
69 for (; (__bits || __num != __badval) && !__err; ++__it, ++__pos) {
78 if (__ctp && __num != __badval) {
79 if (__ctp->is (_STD::ctype_base::digit, __ch))
80 __num = __num * 10 + __ctp->narrow (__ch,
'0') -
'0';
86 for (_RWSTD_SIZE_T __k = 0; __k != __count; ++__k) {
88 typedef _STD::char_traits<_CharT> _Traits;
90 const _RWSTD_SIZE_T __mask =
93 if (__bits & __mask) {
96 if ( __pos < __sizes [__k]
99 _Traits::eq ((__ctp->toupper)(__names [__k][__pos]),
100 (__ctp->toupper)(__ch))
101 : _Traits::eq (__names [__k][__pos], __ch))) {
104 if (__badval == __inx) {
108 else if ( __k != __inx
109 && __sizes [__k] == __sizes [__inx]
110 && __pos + 1 == __sizes [__inx]) {
117 else if ( __sizes [__k] < __sizes [__inx]
118 || __pos >= __sizes [__inx]) {
126 if (__badval == __inx && __badval == __num)
133 if (__err && __pos == __sizes [__k]) {
149 if (1 == __nmatch && __pos + 1 == __sizes [__inx])
155 if (__matchmax < __nmatch || __pos < __sizes [__inx])
158 if (__ctp && __badval == __inx && !__err && __num != __badval) {
162 if (++__it == __end) {
169 if (__ctp->is (_STD::ctype_base::digit, __ch))
170 __num = __num * 10 + __ctp->narrow (__ch,
'0') -
'0';
175 __inx = __count + __num;
#define _RWSTD_USE_FACET(type, arg)
#define _RWSTD_STATIC_CAST(T, x)
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_IOS_EOFBIT
#define _RWSTD_ASSERT(ignore)