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 Attributes | List of all members
time_put< _Elem, _OutIt > Class Template Reference
Inheritance diagram for time_put< _Elem, _OutIt >:
locale::facet _Facet_base time_put_byname< _Elem, _OutIt >

Public Types

typedef _Elem char_type
 
typedef _OutIt iter_type
 
typedef ctype< _Elem > _Ctype
 

Public Member Functions

_OutIt __CLR_OR_THIS_CALL put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const tm *_Pt, const _Elem *_Fmtfirst, const _Elem *_Fmtlast) const
 
_OutIt __CLR_OR_THIS_CALL put (_OutIt _Dest, ios_base &_Iosbase, _Elem _Fill, const tm *_Pt, char _Specifier, char _Modifier= '\0') const
 
__CLR_OR_THIS_CALL time_put (size_t _Refs=0)
 
__CLR_OR_THIS_CALL time_put (const _Locinfo &_Lobj, size_t _Refs=0)
 
- 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_put () _NOEXCEPT
 
void __CLR_OR_THIS_CALL _Init (const _Locinfo &_Lobj)
 
virtual _OutIt __CLR_OR_THIS_CALL do_put (_OutIt _Dest, ios_base &, _Elem, const tm *_Pt, char _Specifier, char _Modifier= '\0') 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 Attributes

_Locinfo::_Timevec _Tnames
 

Member Typedef Documentation

template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef ctype<_Elem> time_put< _Elem, _OutIt >::_Ctype
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef _Elem time_put< _Elem, _OutIt >::char_type
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
typedef _OutIt time_put< _Elem, _OutIt >::iter_type

Constructor & Destructor Documentation

template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
__CLR_OR_THIS_CALL time_put< _Elem, _OutIt >::time_put ( size_t  _Refs = 0)
inlineexplicit
741  { // construct from current locale
742  _BEGIN_LOCINFO(_Lobj)
743  _Init(_Lobj);
744  _END_LOCINFO()
745  }
Definition: xlocale:102
_Atomic_counter_t _Refs
Definition: xlocale:157
void __CLR_OR_THIS_CALL _Init(const _Locinfo &_Lobj)
Definition: xloctime:767
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
__CLR_OR_THIS_CALL time_put< _Elem, _OutIt >::time_put ( const _Locinfo _Lobj,
size_t  _Refs = 0 
)
inline
749  { // construct from specified locale
750  _Init(_Lobj);
751  }
Definition: xlocale:102
_Atomic_counter_t _Refs
Definition: xlocale:157
void __CLR_OR_THIS_CALL _Init(const _Locinfo &_Lobj)
Definition: xloctime:767
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual __CLR_OR_THIS_CALL time_put< _Elem, _OutIt >::~time_put ( )
inlineprotectedvirtual
764  { // destroy the object
765  }

Member Function Documentation

template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
static size_t __CLRCALL_OR_CDECL time_put< _Elem, _OutIt >::_Getcat ( const locale::facet **  _Ppf = 0,
const locale _Ploc = 0 
)
inlinestatic
755  { // return locale category mask and construct standard facet
756  if (_Ppf != 0 && *_Ppf == 0)
758  _Locinfo(_Ploc->c_str()));
759  return (_X_TIME);
760  }
Definition: xloctime:679
#define _NEW_CRT
Definition: xdebug:69
Definition: xlocinfo:54
const char * c_str() const
Definition: xlocale:460
#define _X_TIME
Definition: xlocinfo.h:42
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
void __CLR_OR_THIS_CALL time_put< _Elem, _OutIt >::_Init ( const _Locinfo _Lobj)
inlineprotected
768  { // initialize from _Lobj
769  _Tnames = _Lobj._Gettnames();
770  }
_Timevec __CLR_OR_THIS_CALL _Gettnames() const
Definition: xlocinfo:130
_Locinfo::_Timevec _Tnames
Definition: xloctime:802
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual _OutIt __CLR_OR_THIS_CALL time_put< _Elem, _OutIt >::do_put ( _OutIt  _Dest,
ios_base ,
_Elem  ,
const tm _Pt,
char  _Specifier,
char  _Modifier = '\0' 
) const
inlineprotectedvirtual
775  { // put formatted time from _Pt to _Dest for [_Fmtfirst, _Fmtlast)
776  _DEBUG_POINTER(_Dest);
777  _DEBUG_POINTER(_Pt);
778 
779  char _Fmt[5] = "!%x\0"; // '!' for nonzero count, null for modifier
780  size_t _Count, _Num;
781  string _Str;
782 
783  if (_Modifier == '\0')
784  _Fmt[2] = _Specifier;
785  else
786  { // add both modifier and specifier
787  _Fmt[2] = _Modifier;
788  _Fmt[3] = _Specifier;
789  }
790 
791  for (_Num = 16; ; _Num *= 2)
792  { // convert into ever larger string buffer until success
793  _Str.append(_Num, '\0');
794  if (0 < (_Count = _Strftime(&*_Str.begin(), _Str.size(),
795  _Fmt, _Pt, _Tnames._Getptr())))
796  break;
797  }
798  return (_STD copy(&_Str[1], &_Str[_Count], _Dest));
799  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2072
_CRTIMP size_t __cdecl _Strftime(_Out_writes_(_Maxsize) char *, _In_ size_t _Maxsize, _In_z_ _Printf_format_string_ const char *, _In_ const struct tm *, void *)
#define _DEBUG_POINTER(first)
Definition: xutility:465
iterator begin() _NOEXCEPT
Definition: xstring:1598
_Locinfo::_Timevec _Tnames
Definition: xloctime:802
size_type size() const _NOEXCEPT
Definition: xstring:1752
_Diff _Count
Definition: algorithm:1941
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:972
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLR_OR_THIS_CALL time_put< _Elem, _OutIt >::put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
const tm _Pt,
const _Elem *  _Fmtfirst,
const _Elem *  _Fmtlast 
) const
inline
690  { // put formatted time from _Pt to _Dest for [_Fmtfirst, _Fmtlast)
691  _DEBUG_POINTER(_Dest);
692  _DEBUG_POINTER(_Pt);
693  const _Ctype& _Ctype_fac = _USE(_Iosbase.getloc(), _Ctype);
694 
695  for (; _Fmtfirst != _Fmtlast; ++_Fmtfirst)
696  if (_Ctype_fac.narrow(*_Fmtfirst) != '%')
697  *_Dest++ = *_Fmtfirst; // copy literal element
698  else if (++_Fmtfirst == _Fmtlast)
699  { // treat trailing % as %%
700  *_Dest++ = _Fmtfirst[-1];
701  break;
702  }
703  else
704  { // get specifier after %
705  char _Specifier = _Ctype_fac.narrow(*_Fmtfirst);
706  char _Modifier = '\0';
707  _Elem _Percent = _Fmtfirst[-1];
708 
709  if (_Specifier != 'E' && _Specifier != 'O'
710  && _Specifier != 'Q' && _Specifier != '#')
711  ; // not [E0Q#] qualifier, treat as specifier
712  else if (++_Fmtfirst == _Fmtlast)
713  { // no specifier, copy %[E0Q#] as literal elements
714  *_Dest++ = _Percent;
715  *_Dest++ = _Specifier;
716  break;
717  }
718  else
719  { // save both qualifier and specifier
720  _Modifier = _Specifier;
721  _Specifier = _Ctype_fac.narrow(*_Fmtfirst);
722  }
723 
724  _Dest = do_put(_Dest, _Iosbase, _Fill, _Pt,
725  _Specifier, _Modifier); // convert a single field
726  }
727  return (_Dest);
728  }
ctype< _Elem > _Ctype
Definition: xloctime:685
#define _USE(loc, fac)
Definition: xlocale:555
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:422
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &, _Elem, const tm *_Pt, char _Specifier, char _Modifier= '\0') const
Definition: xloctime:772
#define _DEBUG_POINTER(first)
Definition: xutility:465
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_OutIt __CLR_OR_THIS_CALL time_put< _Elem, _OutIt >::put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
const tm _Pt,
char  _Specifier,
char  _Modifier = '\0' 
) const
inline
733  { // put formatted time from _Pt to _Dest for _Specifier/_Modifier
734  return (do_put(_Dest, _Iosbase, _Fill, _Pt, _Specifier, _Modifier));
735  }
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &, _Elem, const tm *_Pt, char _Specifier, char _Modifier= '\0') const
Definition: xloctime:772
void _Fill(_FwdIt _First, _FwdIt _Last, const _Ty &_Val)
Definition: xutility:2597

Member Data Documentation

template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
_Locinfo::_Timevec time_put< _Elem, _OutIt >::_Tnames
private
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
__PURE_APPDOMAIN_GLOBAL locale::id time_put< _Elem, _OutIt >::id
static

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