STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
time_get< _Elem, _InIt > Class Template Reference
Inheritance diagram for time_get< _Elem, _InIt >:
time_base locale::facet _Facet_base time_get_byname< _Elem, _InIt >

Public Types

typedef _Elem char_type
 
typedef _InIt iter_type
 
typedef ctype< _Elem > _Ctype
 
- Public Types inherited from time_base
enum  dateorder {
  no_order, dmy, mdy, ymd,
  ydm
}
 

Public Member Functions

dateorder __CLR_OR_THIS_CALL date_order () const
 
_InIt __CLR_OR_THIS_CALL get_time (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
 
_InIt __CLR_OR_THIS_CALL get_date (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
 
_InIt __CLR_OR_THIS_CALL get_weekday (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
 
_InIt __CLR_OR_THIS_CALL get_monthname (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
 
_InIt __CLR_OR_THIS_CALL get_year (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt, char _Specifier, char _Modifier= '\0') const
 
_InIt __CLR_OR_THIS_CALL get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt, const _Elem *_Fmtfirst, const _Elem *_Fmtlast) const
 
__CLR_OR_THIS_CALL time_get (size_t _Refs=0)
 
__CLR_OR_THIS_CALL time_get (const _Locinfo &_Lobj, size_t _Refs=0)
 
- Public Member Functions inherited from time_base
__CLR_OR_THIS_CALL time_base (size_t _Refs=0)
 
__CLR_OR_THIS_CALL ~time_base () _NOEXCEPT
 
- Public Member Functions inherited from locale::facet
virtual void __CLR_OR_THIS_CALL _Incref ()
 
virtual _Facet_base *__CLR_OR_THIS_CALL _Decref ()
 
__CLR_OR_THIS_CALL facet (const facet &)=delete
 
facet &__CLR_OR_THIS_CALL operator= (const facet &)=delete
 
- Public Member Functions inherited from _Facet_base
virtual __CLR_OR_THIS_CALL ~_Facet_base () _NOEXCEPT
 

Static Public Member Functions

static size_t __CLRCALL_OR_CDECL _Getcat (const locale::facet **_Ppf=0, const locale *_Ploc=0)
 
- Static Public Member Functions inherited from locale::facet
static size_t __CLRCALL_OR_CDECL _Getcat (const facet **=0, const locale *=0)
 

Static Public Attributes

static __PURE_APPDOMAIN_GLOBAL locale::id id
 

Protected Member Functions

virtual __CLR_OR_THIS_CALL ~time_get () _NOEXCEPT
 
__CLR_OR_THIS_CALL time_get (const char *_Locname, size_t _Refs=0)
 
template<class _Elem2 >
void _Getvals (_Elem2, const _Locinfo &_Lobj)
 
template<>
void _Getvals (wchar_t, const _Locinfo &_Lobj)
 
void __CLR_OR_THIS_CALL _Init (const _Locinfo &_Lobj)
 
virtual dateorder __CLR_OR_THIS_CALL do_date_order () const
 
virtual _InIt __CLR_OR_THIS_CALL do_get_time (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get_date (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get_weekday (_InIt _First, _InIt _Last, ios_base &, ios_base::iostate &_State, tm *_Pt) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get_monthname (_InIt _First, _InIt _Last, ios_base &, ios_base::iostate &_State, tm *_Pt) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get_year (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
 
virtual _InIt __CLR_OR_THIS_CALL do_get (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt, char _Specifier, char=0) const
 
_InIt __CLR_OR_THIS_CALL _Getfmt (_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt, const char *_Fmtfirst) const
 
- Protected Member Functions inherited from locale::facet
__CLR_OR_THIS_CALL facet (size_t _Initrefs=0)
 
virtual __CLR_OR_THIS_CALL ~facet () _NOEXCEPT
 

Private Member Functions

ios_base::iostate __CLRCALL_OR_CDECL _Getint (_InIt &_First, _InIt &_Last, int _Lo, int _Hi, int &_Val, const _Ctype &_Ctype_fac) const
 
void __CLR_OR_THIS_CALL _Tidy ()
 

Private Attributes

const _Elem * _Days
 
const _Elem * _Months
 
const _Elem * _Ampm
 
dateorder _Dateorder
 
_Locinfo::_Cvtvec _Cvt
 

Member Typedef Documentation

template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef ctype<_Elem> time_get< _Elem, _InIt >::_Ctype
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef _Elem time_get< _Elem, _InIt >::char_type
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef _InIt time_get< _Elem, _InIt >::iter_type

Constructor & Destructor Documentation

template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
__CLR_OR_THIS_CALL time_get< _Elem, _InIt >::time_get ( size_t  _Refs = 0)
inlineexplicit
160  : time_base(_Refs)
161  { // construct from current locale
162  _BEGIN_LOCINFO(_Lobj)
163  _Init(_Lobj);
164  _END_LOCINFO()
165  }
__CLR_OR_THIS_CALL time_base(size_t _Refs=0)
Definition: xloctime:25
_Atomic_counter_t _Refs
Definition: xlocale:157
void __CLR_OR_THIS_CALL _Init(const _Locinfo &_Lobj)
Definition: xloctime:216
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
__CLR_OR_THIS_CALL time_get< _Elem, _InIt >::time_get ( const _Locinfo _Lobj,
size_t  _Refs = 0 
)
inline
168  : time_base(_Refs)
169  { // construct from specified locale
170  _Init(_Lobj);
171  }
__CLR_OR_THIS_CALL time_base(size_t _Refs=0)
Definition: xloctime:25
_Atomic_counter_t _Refs
Definition: xlocale:157
void __CLR_OR_THIS_CALL _Init(const _Locinfo &_Lobj)
Definition: xloctime:216
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::~time_get ( )
inlineprotectedvirtual
184  { // destroy the object
185  _Tidy();
186  }
void __CLR_OR_THIS_CALL _Tidy()
Definition: xloctime:634
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
__CLR_OR_THIS_CALL time_get< _Elem, _InIt >::time_get ( const char *  _Locname,
size_t  _Refs = 0 
)
inlineprotected
189  : time_base(_Refs)
190  { // construct from specified locale
191  _BEGIN_LOCINFO(_Lobj(_Locname))
192  _Init(_Lobj);
193  _END_LOCINFO()
194  }
__CLR_OR_THIS_CALL time_base(size_t _Refs=0)
Definition: xloctime:25
_Atomic_counter_t _Refs
Definition: xlocale:157
void __CLR_OR_THIS_CALL _Init(const _Locinfo &_Lobj)
Definition: xloctime:216

Member Function Documentation

template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
static size_t __CLRCALL_OR_CDECL time_get< _Elem, _InIt >::_Getcat ( const locale::facet **  _Ppf = 0,
const locale _Ploc = 0 
)
inlinestatic
175  { // return locale category mask and construct standard facet
176  if (_Ppf != 0 && *_Ppf == 0)
178  _Locinfo(_Ploc->c_str()));
179  return (_X_TIME);
180  }
#define _NEW_CRT
Definition: xdebug:69
Definition: xlocinfo:54
const char * c_str() const
Definition: xlocale:460
#define _X_TIME
Definition: xlocinfo.h:42
Definition: xloctime:38
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::_Getfmt ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt,
const char *  _Fmtfirst 
) const
inlineprotected
563  { // get formatted time for format NTBS
564  const _Ctype& _Ctype_fac = _USE(_Iosbase.getloc(), _Ctype);
565 
566  for (; *_Fmtfirst != '\0'; ++_Fmtfirst)
567  if (*_Fmtfirst == '%')
568  _First = do_get(_First, _Last, _Iosbase, _State, _Pt,
569  *++_Fmtfirst); // convert a single field
570  else if (*_Fmtfirst == ' ')
571  for (; _First != _Last
572  && _Ctype_fac.is(_Ctype::space, *_First); ++_First)
573  ;
574  else if (_Ctype_fac.narrow(*_First) != *_Fmtfirst)
575  { // bad literal match
576  _State |= ios_base::failbit;
577  break;
578  }
579  else
580  ++_First;
581  if (_First == _Last)
582  _State |= ios_base::eofbit;
583  return (_First);
584  }
static const _Iostate failbit
Definition: xiosbase:89
#define _USE(loc, fac)
Definition: xlocale:555
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt, char _Specifier, char=0) const
Definition: xloctime:415
Definition: xlocale:2095
ctype< _Elem > _Ctype
Definition: xloctime:44
_FwdIt _Last
Definition: algorithm:1936
static const _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
ios_base::iostate __CLRCALL_OR_CDECL time_get< _Elem, _InIt >::_Getint ( _InIt &  _First,
_InIt &  _Last,
int  _Lo,
int  _Hi,
int _Val,
const _Ctype _Ctype_fac 
) const
inlineprivate
591  { // get integer in range [_Lo, _Hi] from [_First, _Last)
592  char _Ac[_MAX_INT_DIG], *_Ep;
593  char *_Ptr = _Ac;
594  char _Ch;
595 
596  if (_First == _Last)
597  ;
598  else if ((_Ch = _Ctype_fac.narrow(*_First)) == '+')
599  *_Ptr++ = '+', ++_First; // copy plus sign
600  else if (_Ch == '-')
601  *_Ptr++ = '-', ++_First; // copy minus sign
602 
603  bool _Seendigit = false;
604  while (_First != _Last && _Ctype_fac.narrow(*_First) == '0')
605  _Seendigit = true, ++_First; // strip leading zeros
606  if (_Seendigit)
607  *_Ptr++ = '0'; // replace one or more with single zero
608 
609  for (char *const _Pe = &_Ac[_MAX_INT_DIG - 1]; _First != _Last
610  && '0' <= (_Ch = _Ctype_fac.narrow(*_First)) && _Ch <= '9';
611  _Seendigit = true, ++_First)
612  { // copy digits
613  *_Ptr = _Ch;
614  if (_Ptr < _Pe)
615  ++_Ptr; // drop trailing digits if already too large
616  }
617 
618  if (!_Seendigit)
619  _Ptr = _Ac;
620  *_Ptr = '\0';
621  int _Errno = 0;
622  const long _Ans = _CSTD _Stolx(_Ac, &_Ep, 10, &_Errno);
623  ios_base::iostate _State = ios_base::goodbit;
624 
625  if (_First == _Last)
626  _State |= ios_base::eofbit;
627  if (_Ep == _Ac || _Errno != 0 || _Ans < _Lo || _Hi < _Ans)
628  _State |= ios_base::failbit; // bad conversion
629  else
630  _Val = _Ans; // store valid result
631  return (_State);
632  }
static const _Iostate failbit
Definition: xiosbase:89
#define _MAX_INT_DIG
Definition: yvals.h:583
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
static const _Iostate goodbit
Definition: xiosbase:87
_CRTIMP2_PURE long __CLRCALL_PURE_OR_CDECL _Stolx(const char *, _Out_opt_ _Deref_post_opt_valid_ char **, int, int *)
#define _CSTD
Definition: yvals.h:559
_FwdIt const _Ty _Val
Definition: algorithm:1938
_FwdIt _Last
Definition: algorithm:1936
static const _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
template<class _Elem2 >
void time_get< _Elem, _InIt >::_Getvals ( _Elem2  ,
const _Locinfo _Lobj 
)
inlineprotected
198  { // get values
199  _Cvt = _Lobj._Getcvt();
200  _Days = _MAKLOCSTR(_Elem, _Lobj._Getdays(), _Cvt);
201  _Months = _MAKLOCSTR(_Elem, _Lobj._Getmonths(), _Cvt);
202  _Ampm = _MAKLOCSTR(_Elem, ":AM:am:PM:pm", _Cvt);
203  }
const _Elem * _Ampm
Definition: xloctime:643
const _Elem * _Months
Definition: xloctime:642
_Cvtvec __CLR_OR_THIS_CALL _Getcvt() const
Definition: xlocinfo:120
const char *__CLR_OR_THIS_CALL _Getmonths() const
Definition: xlocinfo:149
_Locinfo::_Cvtvec _Cvt
Definition: xloctime:645
const _Elem * _Days
Definition: xloctime:641
#define _MAKLOCSTR(Elem, str, cvt)
Definition: xlocale:721
const char *__CLR_OR_THIS_CALL _Getdays() const
Definition: xlocinfo:135
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
template<>
void time_get< _Elem, _InIt >::_Getvals ( wchar_t  ,
const _Locinfo _Lobj 
)
inlineprotected
207  { // get values
208  _Cvt = _Lobj._Getcvt();
209  _Days = (const _Elem *)_Maklocwcs(
210  (const wchar_t *)_Lobj._W_Getdays());
211  _Months = (const _Elem *)_Maklocwcs(
212  (const wchar_t *)_Lobj._W_Getmonths());
213  _Ampm = (const _Elem *)_Maklocwcs(L":AM:am:PM:pm");
214  }
const _Elem * _Ampm
Definition: xloctime:643
const _Elem * _Months
Definition: xloctime:642
wchar_t * _Maklocwcs(const wchar_t *_Ptr)
Definition: xlocnum:62
_Cvtvec __CLR_OR_THIS_CALL _Getcvt() const
Definition: xlocinfo:120
const unsigned short *__CLR_OR_THIS_CALL _W_Getdays() const
Definition: xlocinfo:185
_Locinfo::_Cvtvec _Cvt
Definition: xloctime:645
const _Elem * _Days
Definition: xloctime:641
const unsigned short *__CLR_OR_THIS_CALL _W_Getmonths() const
Definition: xlocinfo:200
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
void __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::_Init ( const _Locinfo _Lobj)
inlineprotected
217  { // initialize from _Lobj
218  _Days = 0;
219  _Months = 0;
220  _Ampm = 0;
221 
222  _TRY_BEGIN
223  _Getvals((_Elem)0, _Lobj);
224 
226 
227  _CATCH_ALL
228  _Tidy();
229  _RERAISE;
230  _CATCH_END
231  }
const _Elem * _Ampm
Definition: xloctime:643
int __CLR_OR_THIS_CALL _Getdateorder() const
Definition: xlocinfo:175
const _Elem * _Months
Definition: xloctime:642
#define _TRY_BEGIN
Definition: xstddef:60
void _Getvals(_Elem2, const _Locinfo &_Lobj)
Definition: xloctime:197
#define _CATCH_END
Definition: xstddef:63
dateorder _Dateorder
Definition: xloctime:644
dateorder
Definition: xloctime:21
#define _CATCH_ALL
Definition: xstddef:62
const _Elem * _Days
Definition: xloctime:641
#define _RERAISE
Definition: xstddef:74
void __CLR_OR_THIS_CALL _Tidy()
Definition: xloctime:634
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
void __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::_Tidy ( )
inlineprivate
635  { // free all storage
636  _DELETE_CRT_VEC((void *)_Days);
637  _DELETE_CRT_VEC((void *)_Months);
638  _DELETE_CRT_VEC((void *)_Ampm);
639  }
const _Elem * _Ampm
Definition: xloctime:643
const _Elem * _Months
Definition: xloctime:642
const _Elem * _Days
Definition: xloctime:641
#define _DELETE_CRT_VEC(ptr)
Definition: xdebug:71
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
dateorder __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::date_order ( ) const
inline
49  { // return date order code
50  return (do_date_order());
51  }
virtual dateorder __CLR_OR_THIS_CALL do_date_order() const
Definition: xloctime:233
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual dateorder __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::do_date_order ( ) const
inlineprotectedvirtual
234  { // return date order code
235  return (_Dateorder);
236  }
dateorder _Dateorder
Definition: xloctime:644
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::do_get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt,
char  _Specifier,
char  = 0 
) const
inlineprotectedvirtual
418  { // get formatted time for _Specifier (_Modifier ignored)
419  const _Ctype& _Ctype_fac = _USE(_Iosbase.getloc(), _Ctype);
420  int _Ans = 0;
421 
422  switch (_Specifier)
423  { // process format specifier
424  case 'a':
425  case 'A':
426  _First = get_weekday(_First, _Last, _Iosbase, _State, _Pt);
427  break;
428 
429  case 'b':
430  case 'B':
431  case 'h':
432  _First = get_monthname(_First, _Last, _Iosbase, _State, _Pt);
433  break;
434 
435  case 'c':
436  _First = _Getfmt(_First, _Last, _Iosbase, _State, _Pt,
437  "%b %d %H : %M : %S %Y");
438  break;
439 
440  case 'C':
441  _State |= _Getint(_First, _Last, 0, 99,
442  _Ans, _Ctype_fac);
443  if (!(_State & ios_base::failbit))
444  _Pt->tm_year = _Ans * 100 - 1900; // convert to century
445  break;
446 
447  case 'd':
448  case 'e':
449  _State |= _Getint(_First, _Last, 1, 31,
450  _Pt->tm_mday, _Ctype_fac);
451  break;
452 
453  case 'D':
454  _First = _Getfmt(_First, _Last, _Iosbase, _State, _Pt,
455  "%m / %d / %y");
456  break;
457 
458  case 'H':
459  _State |= _Getint(_First, _Last, 0, 23,
460  _Pt->tm_hour, _Ctype_fac);
461  break;
462 
463  case 'I':
464  _State |= _Getint(_First, _Last, 0, 11,
465  _Pt->tm_hour, _Ctype_fac);
466  break;
467 
468  case 'j':
469  _State |= _Getint(_First, _Last, 1, 366,
470  _Pt->tm_yday, _Ctype_fac);
471  break;
472 
473  case 'm':
474  _State |= _Getint(_First, _Last, 1, 12,
475  _Ans, _Ctype_fac);
476  if (!(_State & ios_base::failbit))
477  _Pt->tm_mon = _Ans - 1;
478  break;
479 
480  case 'M':
481  _State |= _Getint(_First, _Last, 0, 59,
482  _Pt->tm_min, _Ctype_fac);
483  break;
484 
485  case 'n':
486  case 't':
487  _First = _Getfmt(_First, _Last, _Iosbase, _State, _Pt,
488  " ");
489  break;
490 
491  case 'p':
492  _Ans = _Getloctxt(_First, _Last, (size_t)0, ":AM:am:PM:pm");
493  if (_Ans < 0)
494  _State |= ios_base::failbit;
495  else
496  _Pt->tm_hour += _Ans * 12;
497  break;
498 
499  case 'r':
500  _First = _Getfmt(_First, _Last, _Iosbase, _State, _Pt,
501  "%I : %M : %S %p");
502  break;
503 
504  case 'R':
505  _First = _Getfmt(_First, _Last, _Iosbase, _State, _Pt,
506  "%H : %M");
507  break;
508 
509  case 'S':
510  _State |= _Getint(_First, _Last, 0, 59,
511  _Pt->tm_sec, _Ctype_fac);
512  break;
513 
514  case 'T':
515  case 'X':
516  _First = _Getfmt(_First, _Last, _Iosbase, _State, _Pt,
517  "%H : %M : S");
518  break;
519 
520  case 'U':
521  _State |= _Getint(_First, _Last, 0, 53,
522  _Pt->tm_yday, _Ctype_fac);
523  break;
524 
525  case 'w':
526  _State |= _Getint(_First, _Last, 0, 6,
527  _Pt->tm_wday, _Ctype_fac);
528  break;
529 
530  case 'W':
531  _State |= _Getint(_First, _Last, 0, 53,
532  _Pt->tm_yday, _Ctype_fac);
533  break;
534 
535  case 'x':
536  _First = _Getfmt(_First, _Last, _Iosbase, _State, _Pt,
537  "%d / %m / %y");
538  break;
539 
540  case 'y':
541  _State |= _Getint(_First, _Last, 0, 99,
542  _Ans, _Ctype_fac);
543  if (!(_State & ios_base::failbit))
544  _Pt->tm_year = _Ans < 69 ? _Ans + 100 : _Ans;
545  break;
546 
547  case 'Y':
548  _First = get_year(_First, _Last, _Iosbase, _State, _Pt);
549  break;
550 
551  default:
552  _State |= ios_base::failbit; // unknown specifier
553  }
554 
555  if (_First == _Last)
556  _State |= ios_base::eofbit;
557  return (_First);
558  }
int tm_min
Definition: time.h:115
static const _Iostate failbit
Definition: xiosbase:89
int tm_mday
Definition: time.h:117
#define _USE(loc, fac)
Definition: xlocale:555
int tm_year
Definition: time.h:119
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
int tm_mon
Definition: time.h:118
_InIt __CLR_OR_THIS_CALL get_monthname(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
Definition: xloctime:71
_InIt __CLR_OR_THIS_CALL get_year(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
Definition: xloctime:77
int tm_wday
Definition: time.h:120
int tm_yday
Definition: time.h:121
ctype< _Elem > _Ctype
Definition: xloctime:44
_InIt __CLR_OR_THIS_CALL _Getfmt(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt, const char *_Fmtfirst) const
Definition: xloctime:560
ios_base::iostate __CLRCALL_OR_CDECL _Getint(_InIt &_First, _InIt &_Last, int _Lo, int _Hi, int &_Val, const _Ctype &_Ctype_fac) const
Definition: xloctime:587
int tm_sec
Definition: time.h:114
int tm_hour
Definition: time.h:116
_FwdIt _Last
Definition: algorithm:1936
int __CRTDECL _Getloctxt(_InIt &_First, _InIt &_Last, size_t _Numfields, const _Elem *_Ptr)
Definition: xlocale:612
_InIt __CLR_OR_THIS_CALL get_weekday(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
Definition: xloctime:65
static const _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::do_get_date ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt 
) const
inlineprotectedvirtual
266  { // get date from [_First, _Last) into _Pt
267  _DEBUG_RANGE(_First, _Last);
268  _DEBUG_POINTER(_Pt);
269  const _Ctype& _Ctype_fac = _USE(_Iosbase.getloc(), _Ctype);
270 
271  dateorder _Dorder = date_order();
272  if (_Dorder == no_order)
273  _Dorder = mdy;
274 
275  if (_First == _Last)
276  ;
277  else if (!_Ctype_fac.is(_Ctype::digit, *_First))
278  { // begins with month name, assume mdy
279  _First = get_monthname(_First, _Last, _Iosbase, _State, _Pt);
280  _Dorder = mdy;
281  }
282  else if (_Dorder == mdy)
283  { // get month number
284  _State |= _Getint(_First, _Last, 1, 12,
285  _Pt->tm_mon, _Ctype_fac);
286  --_Pt->tm_mon;
287  }
288  else if (_Dorder == dmy)
289  _State |= _Getint(_First, _Last, 1, 31,
290  _Pt->tm_mday, _Ctype_fac);
291  else // ymd or ydm
292  _First = get_year(_First, _Last, _Iosbase, _State, _Pt);
293 
294  while (_First != _Last && _Ctype_fac.is(_Ctype::space, *_First))
295  ++_First; // skip spaces
296 
297  if (_First != _Last)
298  { // skip [:,/]
299  char _Ch = _Ctype_fac.narrow(*_First);
300  if (_Ch == ':' || _Ch == ',' || _Ch == '/')
301  ++_First;
302  }
303  while (_First != _Last && _Ctype_fac.is(_Ctype::space, *_First))
304  ++_First; // skip spaces
305 
306  if (_First == _Last)
307  ;
308  else if (!_Ctype_fac.is(_Ctype::digit, *_First))
309  if (_Dorder == mdy)
310  _State |= ios_base::failbit; // error, month already seen
311  else
312  { // month name is second, like it or not
313  _First = get_monthname(_First, _Last, _Iosbase, _State, _Pt);
314  if (_Dorder == ydm)
315  _Dorder = ymd;
316  }
317  else if (_Dorder == dmy || _Dorder == ymd)
318  { // get month number
319  _State |= _Getint(_First, _Last, 1, 12,
320  _Pt->tm_mon, _Ctype_fac);
321  --_Pt->tm_mon;
322  }
323  else
324  _State |= _Getint(_First, _Last, 1, 31,
325  _Pt->tm_mday, _Ctype_fac);
326 
327  while (_First != _Last && _Ctype_fac.is(_Ctype::space, *_First))
328  ++_First; // skip spaces
329  if (_First != _Last)
330  { // skip [:,/]
331  char _Ch = _Ctype_fac.narrow(*_First);
332  if (_Ch == ':' || _Ch == ',' || _Ch == '/')
333  ++_First;
334  }
335  while (_First != _Last && _Ctype_fac.is(_Ctype::space, *_First))
336  ++_First; // skip spaces
337 
338  if (_First == _Last)
339  _State |= ios_base::failbit; // error, missing component(s)
340  else if (!_Ctype_fac.is(_Ctype::digit, *_First))
341  if (_Dorder != ydm)
342  _State |= ios_base::failbit; // error, month out of place
343  else
344  _First = get_monthname(_First, _Last, _Iosbase, _State, _Pt);
345  else if (_Dorder == ydm)
346  { // get month number
347  _State |= _Getint(_First, _Last, 1, 12,
348  _Pt->tm_mon, _Ctype_fac);
349  --_Pt->tm_mon;
350  }
351  else if (_Dorder == ymd)
352  _State |= _Getint(_First, _Last, 1, 31,
353  _Pt->tm_mday, _Ctype_fac);
354  else // mdy or dmy
355  _First = get_year(_First, _Last, _Iosbase, _State, _Pt);
356 
357  if (_First == _Last)
358  _State |= ios_base::eofbit;
359  return (_First);
360  }
Definition: xlocale:2093
static const _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
int tm_mday
Definition: time.h:117
#define _USE(loc, fac)
Definition: xlocale:555
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
Definition: xloctime:23
dateorder
Definition: xloctime:21
int tm_mon
Definition: time.h:118
Definition: xloctime:23
_InIt __CLR_OR_THIS_CALL get_monthname(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
Definition: xloctime:71
dateorder __CLR_OR_THIS_CALL date_order() const
Definition: xloctime:48
Definition: xloctime:23
#define _DEBUG_POINTER(first)
Definition: xutility:465
Definition: xlocale:2095
_In_ size_t _In_ unsigned int _Ch
Definition: mbstring.h:161
_InIt __CLR_OR_THIS_CALL get_year(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
Definition: xloctime:77
ctype< _Elem > _Ctype
Definition: xloctime:44
ios_base::iostate __CLRCALL_OR_CDECL _Getint(_InIt &_First, _InIt &_Last, int _Lo, int _Hi, int &_Val, const _Ctype &_Ctype_fac) const
Definition: xloctime:587
Definition: xloctime:23
Definition: xloctime:23
_FwdIt _Last
Definition: algorithm:1936
static const _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::do_get_monthname ( _InIt  _First,
_InIt  _Last,
ios_base ,
ios_base::iostate &  _State,
tm _Pt 
) const
inlineprotectedvirtual
380  { // get month from [_First, _Last) into _Pt
381  _DEBUG_RANGE(_First, _Last);
382  _DEBUG_POINTER(_Pt);
383  int _Num = _Getloctxt(_First, _Last, (size_t)0, _Months);
384 
385  if (_Num < 0)
386  _State |= ios_base::failbit;
387  else
388  _Pt->tm_mon = _Num >> 1; // set mon
389  return (_First);
390  }
static const _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
const _Elem * _Months
Definition: xloctime:642
int tm_mon
Definition: time.h:118
#define _DEBUG_POINTER(first)
Definition: xutility:465
_FwdIt _Last
Definition: algorithm:1936
int __CRTDECL _Getloctxt(_InIt &_First, _InIt &_Last, size_t _Numfields, const _Elem *_Ptr)
Definition: xlocale:612
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::do_get_time ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt 
) const
inlineprotectedvirtual
241  { // get time of day from [_First, _Last) into _Pt
242  _DEBUG_RANGE(_First, _Last);
243  _DEBUG_POINTER(_Pt);
244  const _Ctype& _Ctype_fac = _USE(_Iosbase.getloc(), _Ctype);
245 
246  _State |= _Getint(_First, _Last, 0, 23,
247  _Pt->tm_hour, _Ctype_fac);
248 
249  if (_State != ios_base::goodbit || _Ctype_fac.narrow(*_First) != ':')
250  _State |= ios_base::failbit; // hour field is bad
251  else
252  _State |= _Getint(++_First, _Last, 0, 59,
253  _Pt->tm_min, _Ctype_fac);
254 
255  if (_State != ios_base::goodbit || _Ctype_fac.narrow(*_First) != ':')
256  _State |= ios_base::failbit; // min field is bad
257  else
258  _State |= _Getint(++_First, _Last, 0, 59,
259  _Pt->tm_sec, _Ctype_fac);
260  return (_First);
261  }
int tm_min
Definition: time.h:115
static const _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
#define _USE(loc, fac)
Definition: xlocale:555
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
#define _DEBUG_POINTER(first)
Definition: xutility:465
ctype< _Elem > _Ctype
Definition: xloctime:44
static const _Iostate goodbit
Definition: xiosbase:87
ios_base::iostate __CLRCALL_OR_CDECL _Getint(_InIt &_First, _InIt &_Last, int _Lo, int _Hi, int &_Val, const _Ctype &_Ctype_fac) const
Definition: xloctime:587
int tm_sec
Definition: time.h:114
int tm_hour
Definition: time.h:116
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::do_get_weekday ( _InIt  _First,
_InIt  _Last,
ios_base ,
ios_base::iostate &  _State,
tm _Pt 
) const
inlineprotectedvirtual
365  { // get weekday from [_First, _Last) into _Pt
366  _DEBUG_RANGE(_First, _Last);
367  _DEBUG_POINTER(_Pt);
368  int _Num = _Getloctxt(_First, _Last, (size_t)0, _Days);
369 
370  if (_Num < 0)
371  _State |= ios_base::failbit;
372  else
373  _Pt->tm_wday = _Num >> 1; // set wday
374  return (_First);
375  }
static const _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
#define _DEBUG_POINTER(first)
Definition: xutility:465
int tm_wday
Definition: time.h:120
const _Elem * _Days
Definition: xloctime:641
_FwdIt _Last
Definition: algorithm:1936
int __CRTDECL _Getloctxt(_InIt &_First, _InIt &_Last, size_t _Numfields, const _Elem *_Ptr)
Definition: xlocale:612
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::do_get_year ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt 
) const
inlineprotectedvirtual
395  { // get year from [_First, _Last) into _Pt
396  _DEBUG_RANGE(_First, _Last);
397  _DEBUG_POINTER(_Pt);
398  const _Ctype& _Ctype_fac = _USE(_Iosbase.getloc(), _Ctype);
399 
400  int _Ans = 0;
401  _State |= _Getint(_First, _Last, 0, 2035,
402  _Ans, _Ctype_fac);
403 
404  if (!(_State & ios_base::failbit))
405  { // valid input, convert to year
406  if (1900 <= _Ans)
407  _Ans -= 1900; // [1900, ...) as is
408  else if (2035 - 1900 < _Ans)
409  _State |= ios_base::failbit;
410  _Pt->tm_year = _Ans; // set year
411  }
412  return (_First);
413  }
static const _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
#define _USE(loc, fac)
Definition: xlocale:555
int tm_year
Definition: time.h:119
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
#define _DEBUG_POINTER(first)
Definition: xutility:465
ctype< _Elem > _Ctype
Definition: xloctime:44
ios_base::iostate __CLRCALL_OR_CDECL _Getint(_InIt &_First, _InIt &_Last, int _Lo, int _Hi, int &_Val, const _Ctype &_Ctype_fac) const
Definition: xloctime:587
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt,
char  _Specifier,
char  _Modifier = '\0' 
) const
inline
86  { // get formatted time for _Specifier/_Modifier
87  _DEBUG_RANGE(_First, _Last);
88  _DEBUG_POINTER(_Pt);
89  return (do_get(_First, _Last, _Iosbase, _State, _Pt,
90  _Specifier, _Modifier));
91  }
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt, char _Specifier, char=0) const
Definition: xloctime:415
#define _DEBUG_POINTER(first)
Definition: xutility:465
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::get ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt,
const _Elem *  _Fmtfirst,
const _Elem *  _Fmtlast 
) const
inline
96  { // get formatted time for format string
97  const _Ctype& _Ctype_fac = _USE(_Iosbase.getloc(), _Ctype);
98 
99  _DEBUG_RANGE(_First, _Last);
100  _DEBUG_POINTER(_Pt);
101  _DEBUG_RANGE(_Fmtfirst, _Fmtlast);
102 
103  for (; _Fmtfirst != _Fmtlast; ++_Fmtfirst)
104  if (_Ctype_fac.narrow(*_Fmtfirst) != '%')
105  { // match literal element
106  if (_Ctype_fac.is(_Ctype::space, *_Fmtfirst))
107  for (; _First != _Last
108  && _Ctype_fac.is(_Ctype::space, *_First); ++_First)
109  ;
110  else if (*_First != *_Fmtfirst)
111  { // bad literal match
112  _State |= ios_base::failbit;
113  break;
114  }
115  else
116  ++_First;
117  }
118  else if (++_Fmtfirst == _Fmtlast)
119  { // treat trailing % as literal match
120  if (*_First != _Fmtfirst[-1])
121  _State |= ios_base::failbit;
122  else
123  ++_First;
124  break;
125  }
126  else
127  { // get specifier after %
128  char _Specifier = _Ctype_fac.narrow(*_Fmtfirst);
129  char _Modifier = '\0';
130  _Elem _Percent = _Fmtfirst[-1];
131 
132  if (_Specifier != 'E' && _Specifier != 'O'
133  && _Specifier != 'Q' && _Specifier != '#')
134  ; // not [E0Q#] modifier, treat as specifier
135  else if (++_Fmtfirst == _Fmtlast)
136  { // no specifier, treat %[E0Q#] as literal match
137  if (*_First != _Percent
138  || ++_First == _Last
139  || _Ctype_fac.narrow(*_First) != _Specifier)
140  _State |= ios_base::failbit;
141  else
142  ++_First;
143  break;
144  }
145  else
146  { // save both qualifier and specifier
147  _Modifier = _Specifier;
148  _Specifier = _Ctype_fac.narrow(*_Fmtfirst);
149  }
150 
151  _First = do_get(_First, _Last, _Iosbase, _State, _Pt,
152  _Specifier, _Modifier); // convert a single field
153  }
154  if (_First == _Last)
155  _State |= ios_base::eofbit;
156  return (_First);
157  }
static const _Iostate failbit
Definition: xiosbase:89
#define _DEBUG_RANGE(first, last)
Definition: xutility:467
#define _USE(loc, fac)
Definition: xlocale:555
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
virtual _InIt __CLR_OR_THIS_CALL do_get(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt, char _Specifier, char=0) const
Definition: xloctime:415
#define _DEBUG_POINTER(first)
Definition: xutility:465
Definition: xlocale:2095
ctype< _Elem > _Ctype
Definition: xloctime:44
_FwdIt _Last
Definition: algorithm:1936
static const _Iostate eofbit
Definition: xiosbase:88
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::get_date ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt 
) const
inline
61  { // get date from [_First, _Last) into _Pt
62  return (do_get_date(_First, _Last, _Iosbase, _State, _Pt));
63  }
virtual _InIt __CLR_OR_THIS_CALL do_get_date(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
Definition: xloctime:263
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::get_monthname ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt 
) const
inline
73  { // get month from [_First, _Last) into _Pt
74  return (do_get_monthname(_First, _Last, _Iosbase, _State, _Pt));
75  }
virtual _InIt __CLR_OR_THIS_CALL do_get_monthname(_InIt _First, _InIt _Last, ios_base &, ios_base::iostate &_State, tm *_Pt) const
Definition: xloctime:377
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::get_time ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt 
) const
inline
55  { // get time of day from [_First, _Last) into _Pt
56  return (do_get_time(_First, _Last, _Iosbase, _State, _Pt));
57  }
virtual _InIt __CLR_OR_THIS_CALL do_get_time(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
Definition: xloctime:238
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::get_weekday ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt 
) const
inline
67  { // get weekday from [_First, _Last) into _Pt
68  return (do_get_weekday(_First, _Last, _Iosbase, _State, _Pt));
69  }
virtual _InIt __CLR_OR_THIS_CALL do_get_weekday(_InIt _First, _InIt _Last, ios_base &, ios_base::iostate &_State, tm *_Pt) const
Definition: xloctime:362
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_InIt __CLR_OR_THIS_CALL time_get< _Elem, _InIt >::get_year ( _InIt  _First,
_InIt  _Last,
ios_base _Iosbase,
ios_base::iostate &  _State,
tm _Pt 
) const
inline
79  { // get year from [_First, _Last) into _Pt
80  return (do_get_year(_First, _Last, _Iosbase, _State, _Pt));
81  }
virtual _InIt __CLR_OR_THIS_CALL do_get_year(_InIt _First, _InIt _Last, ios_base &_Iosbase, ios_base::iostate &_State, tm *_Pt) const
Definition: xloctime:392
_FwdIt _Last
Definition: algorithm:1936

Member Data Documentation

template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
const _Elem* time_get< _Elem, _InIt >::_Ampm
private
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
_Locinfo::_Cvtvec time_get< _Elem, _InIt >::_Cvt
private
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
dateorder time_get< _Elem, _InIt >::_Dateorder
private
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
const _Elem* time_get< _Elem, _InIt >::_Days
private
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
const _Elem* time_get< _Elem, _InIt >::_Months
private
template<class _Elem , class _InIt = istreambuf_iterator<_Elem, char_traits<_Elem> >>
__PURE_APPDOMAIN_GLOBAL locale::id time_get< _Elem, _InIt >::id
static

The documentation for this class was generated from the following file: