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 _Crt_new_delete 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
746  : locale::facet(_Refs)
747  { // construct from current locale
748  _BEGIN_LOCINFO(_Lobj)
749  _Init(_Lobj);
750  _END_LOCINFO()
751  }
Definition: xlocale:138
void __CLR_OR_THIS_CALL _Init(const _Locinfo &_Lobj)
Definition: xloctime:773
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
754  : locale::facet(_Refs)
755  { // construct from specified locale
756  _Init(_Lobj);
757  }
Definition: xlocale:138
void __CLR_OR_THIS_CALL _Init(const _Locinfo &_Lobj)
Definition: xloctime:773
template<class _Elem , class _OutIt = ostreambuf_iterator<_Elem, char_traits<_Elem> >>
virtual __CLR_OR_THIS_CALL time_put< _Elem, _OutIt >::~time_put ( )
inlineprotectedvirtual
770  { // destroy the object
771  }

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
761  { // return locale category mask and construct standard facet
762  if (_Ppf != 0 && *_Ppf == 0)
763  *_Ppf = new time_put<_Elem, _OutIt>(
764  _Locinfo(_Ploc->c_str()));
765  return (_X_TIME);
766  }
Definition: xloctime:685
Definition: xlocinfo:54
const char * c_str() const
Definition: xlocale:452
#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
774  { // initialize from _Lobj
775  _Tnames = _Lobj._Gettnames();
776  }
_Timevec __CLR_OR_THIS_CALL _Gettnames() const
Definition: xlocinfo:130
_Locinfo::_Timevec _Tnames
Definition: xloctime:808
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
781  { // put formatted time from _Pt to _Dest for [_Fmtfirst, _Fmtlast)
782  _DEBUG_POINTER(_Dest);
783  _DEBUG_POINTER(_Pt);
784 
785  char _Fmt[5] = "!%x\0"; // '!' for nonzero count, null for modifier
786  size_t _Count, _Num;
787  string _Str;
788 
789  if (_Modifier == '\0')
790  _Fmt[2] = _Specifier;
791  else
792  { // add both modifier and specifier
793  _Fmt[2] = _Modifier;
794  _Fmt[3] = _Specifier;
795  }
796 
797  for (_Num = 16; ; _Num *= 2)
798  { // convert into ever larger string buffer until success
799  _Str.append(_Num, '\0');
800  if (0 < (_Count = _Strftime(&*_Str.begin(), _Str.size(),
801  _Fmt, _Pt, _Tnames._Getptr())))
802  break;
803  }
804  return (_STD copy(&_Str[1], &_Str[_Count], _Dest));
805  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
unsigned int _Count
Definition: xcomplex:668
#define _DEBUG_POINTER(first)
Definition: xutility:819
iterator begin() _NOEXCEPT
Definition: xstring:1593
_Locinfo::_Timevec _Tnames
Definition: xloctime:808
size_type size() const _NOEXCEPT
Definition: xstring:1763
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
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
696  { // put formatted time from _Pt to _Dest for [_Fmtfirst, _Fmtlast)
697  _DEBUG_POINTER(_Dest);
698  _DEBUG_POINTER(_Pt);
699  const _Ctype& _Ctype_fac = _USE(_Iosbase.getloc(), _Ctype);
700 
701  for (; _Fmtfirst != _Fmtlast; ++_Fmtfirst)
702  if (_Ctype_fac.narrow(*_Fmtfirst) != '%')
703  *_Dest++ = *_Fmtfirst; // copy literal element
704  else if (++_Fmtfirst == _Fmtlast)
705  { // treat trailing % as %%
706  *_Dest++ = _Fmtfirst[-1];
707  break;
708  }
709  else
710  { // get specifier after %
711  char _Specifier = _Ctype_fac.narrow(*_Fmtfirst);
712  char _Modifier = '\0';
713  _Elem _Percent = _Fmtfirst[-1];
714 
715  if (_Specifier != 'E' && _Specifier != 'O'
716  && _Specifier != 'Q' && _Specifier != '#')
717  ; // not [E0Q#] qualifier, treat as specifier
718  else if (++_Fmtfirst == _Fmtlast)
719  { // no specifier, copy %[E0Q#] as literal elements
720  *_Dest++ = _Percent;
721  *_Dest++ = _Specifier;
722  break;
723  }
724  else
725  { // save both qualifier and specifier
726  _Modifier = _Specifier;
727  _Specifier = _Ctype_fac.narrow(*_Fmtfirst);
728  }
729 
730  _Dest = do_put(_Dest, _Iosbase, _Fill, _Pt,
731  _Specifier, _Modifier); // convert a single field
732  }
733  return (_Dest);
734  }
ctype< _Elem > _Ctype
Definition: xloctime:691
#define _USE(loc, fac)
Definition: xlocale:547
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &, _Elem, const tm *_Pt, char _Specifier, char _Modifier= '\0') const
Definition: xloctime:778
#define _DEBUG_POINTER(first)
Definition: xutility:819
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
739  { // put formatted time from _Pt to _Dest for _Specifier/_Modifier
740  return (do_put(_Dest, _Iosbase, _Fill, _Pt, _Specifier, _Modifier));
741  }
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &, _Elem, const tm *_Pt, char _Specifier, char _Modifier= '\0') const
Definition: xloctime:778

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: