39__rw_get_timepunct (
const __rw_facet *pfacet,
40 int data [4], _RWSTD_C::tm *tmb,
int **pmem,
41 const void *names[], _RWSTD_SIZE_T sizes[]);
49template <
class _CharT,
class _InputIter>
50_RW::__rw_facet_id time_get<_CharT, _InputIter>::id;
55template <
class _CharT,
class _InputIter>
56 time_get<_CharT, _InputIter>::
63template <
class _CharT,
class _InputIter>
64typename time_get<_CharT, _InputIter>::iter_type
65time_get<_CharT, _InputIter>::
66get (iter_type __it, iter_type __end, ios_base &__fl,
_RWSTD_IOSTATE &__err,
67 tm *__tmb,
const char_type *__pat,
const char_type *__pat_end)
const
72 const ctype<char_type> &__ctp =
76 tm __tmp = __tmb ? *__tmb : tm ();
80 char __fmt [] = {
'\0',
'\0' };
82 for (; __pat != __pat_end; ++__pat) {
86 __errtmp |= _RW::__rw_failbit;
90 const char __ch = __ctp.narrow (*__pat,
'\0');
93 if (
'E' == __ch ||
'O' == __ch)
95 else if (
'.' == __ch || __ch >=
'0' && __ch <=
'9') {
99 __it = do_get (__it, __end, __fl, __errtmp, &__tmp, __ch,
101 __fmt [0] = __fmt [1] =
'\0';
104 else if (
'%' == __ch) {
107 else if (__ctp.is (ctype_base::space, *__pat)) {
109 while (__it != __end && __ctp.is (ctype_base::space, *__it))
113 if (__it != __end && __ch == __ctp.narrow (*__it,
'\0'))
117 __errtmp |= _RW::__rw_failbit;
124 if (!(__errtmp & ~_RW::__rw_eofbit) && __tmb)
133template <
class _CharT,
class _InputIter>
134 typename time_get<_CharT, _InputIter>::iter_type
135time_get<_CharT, _InputIter>::
136do_get (iter_type __it, iter_type __end, ios_base &__fl,
138 char __fmt,
char __modifier )
const
141 const char_type* __names [100];
142 _RWSTD_SIZE_T __sizes [
sizeof __names /
sizeof *__names];
147 tm __tmp = __tmb ? *__tmb : tm ();
153 const ctype<char_type> &__ctp =
158 case 'A':
case 'a':
case 'B':
case 'b':
case 'h':
164 case 'n':
case 't': {
169 __err |= _RW::__rw_eofbit;
173 if (!__ctp.is (ctype_base::space, *__it))
186 __fmt, __modifier,
sizeof (char_type) >
sizeof (
char), 0
190 const _RWSTD_SIZE_T __cnt =
191 _RW::__rw_get_timepunct (
this, __data, &__tmp,
192 &__pmem, __pv, __sizes);
199 return get (__it, __end, __fl, __err, __tmb,
200 __names [0], __names [0] + __sizes [0]);
210 _RWSTD_SIZE_T __inx =
'O' == __modifier ? 0 : _RWSTD_SIZE_MAX;
216 int __interr = int (__dup);
218 __it = _RW::__rw_match_name (__it, __end, __names, __sizes,
219 __cnt, __inx, __interr, &__fl);
223 if (__inx == _RWSTD_SIZE_MAX) {
228 if ( !__errtmp && 0 == __sizes [0]
229 && __it != __end &&
'0' == __ctp.narrow (*__it,
'\0')) {
231 while (
'0' == __ctp.narrow (*__it,
'\0')) {
233 if (++__it == __end) {
234 __errtmp |= _RW::__rw_eofbit;
240 __errtmp |= _RW::__rw_failbit;
243 else if (
'p' == __fmt) {
245 if (!__inx && 11 == *__pmem)
247 else if (*__pmem < 12) {
248 if (!__inx || 11 != *__pmem)
249 *__pmem += int (__inx * 12) + 1;
255 __errtmp |= _RW::__rw_failbit;
260 __errtmp |= _RW::__rw_failbit;
266 if (__inx == __cnt && !__sizes [0] || __inx >= 2 * __cnt)
267 *__pmem = int (__inx - __cnt);
268 else if (__inx < __cnt)
269 *__pmem = int (__inx % (__cnt / __dup));
271 __errtmp |= _RW::__rw_failbit;
273 const int __adj = __data [0];
274 const int __fac = __data [1];
276 *__pmem = *__pmem * __fac + __adj;
278 const int __lob = __data [2];
279 const int __hib = __data [3];
282 if (*__pmem < __lob || *__pmem > __hib)
283 __errtmp |= _RW::__rw_failbit;
287 __errtmp |= _RW::__rw_failbit;
294 _RWSTD_SIZE_T __nread = 0;
298 for ( ; ; ++__it, ++__nread) {
300 __err |= _RW::__rw_eofbit;
304 const char_type __c = *__it;
305 if (!__ctp.is (ctype_base::digit, __c))
308 const char __ch = __ctp.narrow (__c,
'\0');
309 if (__ch <
'0' || __ch >
'9')
312 __mem = 10 * __mem + __ch -
'0';
317 const int __adj = __data [0];
318 const int __fac = __data [1];
320 int __lob = __data [2];
321 int __hib = __data [3];
332 __hib = _RWSTD_INT_MAX - 1900;
344 *__pmem = __mem * __fac + __adj;
347 if (*__pmem < __lob || *__pmem > __hib)
348 __errtmp |= _RW::__rw_failbit;
352 __errtmp |= _RW::__rw_failbit;
357 __errtmp |= _RW::__rw_failbit;
360 if (!(__errtmp & ~_RW::__rw_eofbit) && __tmb)
371template <
class _CharT,
class _InputIter>
372 time_get_byname<_CharT, _InputIter>::
#define _RWSTD_USE_FACET(type, arg)
#define _RWSTD_REINTERPRET_CAST(T, x)
#define _RWSTD_NAMESPACE(name)
#define _RWSTD_ASSERT(ignore)