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< wchar_t, _OutIt > Class Template Reference
Inheritance diagram for time_put< wchar_t, _OutIt >:
locale::facet _Facet_base _Crt_new_delete

Public Types

typedef wchar_t _Elem
 
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
 
__CLR_OR_THIS_CALL time_put (const char *_Locname, size_t _Refs=0)
 
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 _OutIt >
typedef ctype<_Elem> time_put< wchar_t, _OutIt >::_Ctype
template<class _OutIt >
typedef wchar_t time_put< wchar_t, _OutIt >::_Elem
template<class _OutIt >
typedef _Elem time_put< wchar_t, _OutIt >::char_type
template<class _OutIt >
typedef _OutIt time_put< wchar_t, _OutIt >::iter_type

Constructor & Destructor Documentation

template<class _OutIt >
__CLR_OR_THIS_CALL time_put< wchar_t, _OutIt >::time_put ( size_t  _Refs = 0)
inlineexplicit
881  : locale::facet(_Refs)
882  { // construct from current locale
883  _BEGIN_LOCINFO(_Lobj)
884  _Init(_Lobj);
885  _END_LOCINFO()
886  }
Definition: xlocale:138
void __CLR_OR_THIS_CALL _Init(const _Locinfo &_Lobj)
Definition: xloctime:916
template<class _OutIt >
__CLR_OR_THIS_CALL time_put< wchar_t, _OutIt >::time_put ( const _Locinfo _Lobj,
size_t  _Refs = 0 
)
inline
889  : locale::facet(_Refs)
890  { // construct from specified locale
891  _Init(_Lobj);
892  }
Definition: xlocale:138
void __CLR_OR_THIS_CALL _Init(const _Locinfo &_Lobj)
Definition: xloctime:916
template<class _OutIt >
virtual __CLR_OR_THIS_CALL time_put< wchar_t, _OutIt >::~time_put ( )
inlineprotectedvirtual
905  { // destroy the object
906  }
template<class _OutIt >
__CLR_OR_THIS_CALL time_put< wchar_t, _OutIt >::time_put ( const char *  _Locname,
size_t  _Refs = 0 
)
inlineprotected
909  : locale::facet(_Refs)
910  { // construct from specified locale
911  _BEGIN_LOCINFO(_Lobj(_Locname))
912  _Init(_Lobj);
913  _END_LOCINFO()
914  }
Definition: xlocale:138
void __CLR_OR_THIS_CALL _Init(const _Locinfo &_Lobj)
Definition: xloctime:916

Member Function Documentation

template<class _OutIt >
static size_t __CLRCALL_OR_CDECL time_put< wchar_t, _OutIt >::_Getcat ( const locale::facet **  _Ppf = 0,
const locale _Ploc = 0 
)
inlinestatic
896  { // return locale category mask and construct standard facet
897  if (_Ppf != 0 && *_Ppf == 0)
898  *_Ppf = new time_put<_Elem, _OutIt>(
899  _Locinfo(_Ploc->c_str()));
900  return (_X_TIME);
901  }
Definition: xloctime:685
Definition: xlocinfo:54
const char * c_str() const
Definition: xlocale:452
#define _X_TIME
Definition: xlocinfo.h:42
template<class _OutIt >
void __CLR_OR_THIS_CALL time_put< wchar_t, _OutIt >::_Init ( const _Locinfo _Lobj)
inlineprotected
917  { // initialize from _Lobj
918  _Tnames = _Lobj._W_Gettnames();
919  }
_Locinfo::_Timevec _Tnames
Definition: xloctime:951
_Timevec __CLR_OR_THIS_CALL _W_Gettnames() const
Definition: xlocinfo:180
template<class _OutIt >
virtual _OutIt __CLR_OR_THIS_CALL time_put< wchar_t, _OutIt >::do_put ( _OutIt  _Dest,
ios_base ,
_Elem  ,
const tm *  _Pt,
char  _Specifier,
char  _Modifier = '\0' 
) const
inlineprotectedvirtual
924  { // put formatted time from _Pt to _Dest for [_Fmtfirst, _Fmtlast)
925  _DEBUG_POINTER(_Dest);
926  _DEBUG_POINTER(_Pt);
927 
928  wchar_t _Fmt[5] = L"!%x\0"; // ! for nonzero count, null for modifier
929  size_t _Count, _Num;
930  wstring _Str;
931 
932  if (_Modifier == '\0')
933  _Fmt[2] = (_Elem)_Specifier; // conversion rule unspecified
934  else
935  { // add both modifier and specifier
936  _Fmt[2] = (_Elem)_Modifier;
937  _Fmt[3] = (_Elem)_Specifier;
938  }
939 
940  for (_Num = 16; ; _Num *= 2)
941  { // convert into ever larger string buffer until success
942  _Str.append(_Num, '\0');
943  if (0 < (_Count = _Wcsftime(&*_Str.begin(), _Str.size(),
944  _Fmt, _Pt, _Tnames._Getptr())))
945  break;
946  }
947  return (_STD copy(&_Str[1], &_Str[_Count], _Dest));
948  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2369
unsigned int _Count
Definition: xcomplex:668
wchar_t _Elem
Definition: xloctime:823
_Locinfo::_Timevec _Tnames
Definition: xloctime:951
#define _DEBUG_POINTER(first)
Definition: xutility:819
iterator begin() _NOEXCEPT
Definition: xstring:1593
size_type size() const _NOEXCEPT
Definition: xstring:1763
Definition: xstring:21
_Myt & append(_XSTD initializer_list< _Elem > _Ilist)
Definition: xstring:998
template<class _OutIt >
_OutIt __CLR_OR_THIS_CALL time_put< wchar_t, _OutIt >::put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
const tm *  _Pt,
const _Elem _Fmtfirst,
const _Elem _Fmtlast 
) const
inline
831  { // put formatted time from _Pt to _Dest for [_Fmtfirst, _Fmtlast)
832  _DEBUG_POINTER(_Dest);
833  _DEBUG_POINTER(_Pt);
834  const _Ctype& _Ctype_fac = _USE(_Iosbase.getloc(), _Ctype);
835 
836  for (; _Fmtfirst != _Fmtlast; ++_Fmtfirst)
837  if (_Ctype_fac.narrow(*_Fmtfirst) != '%')
838  *_Dest++ = *_Fmtfirst; // copy literal element
839  else if (++_Fmtfirst == _Fmtlast)
840  { // treat trailing % as %%
841  *_Dest++ = _Fmtfirst[-1];
842  break;
843  }
844  else
845  { // get specifier after %
846  char _Specifier = _Ctype_fac.narrow(*_Fmtfirst);
847  char _Modifier = '\0';
848  _Elem _Percent = _Fmtfirst[-1];
849 
850  if (_Specifier != 'E' && _Specifier != 'O'
851  && _Specifier != 'Q' && _Specifier != '#')
852  ; // not [E0Q#] qualifier, treat as specifier
853  else if (++_Fmtfirst == _Fmtlast)
854  { // no specifier, copy %[E0Q#] as literal elements
855  *_Dest++ = _Percent;
856  *_Dest++ = _Specifier;
857  break;
858  }
859  else
860  { // save both qualifier and specifier
861  _Modifier = _Specifier;
862  _Specifier = _Ctype_fac.narrow(*_Fmtfirst);
863  }
864 
865  _Dest = do_put(_Dest, _Iosbase, _Fill, _Pt,
866  _Specifier, _Modifier); // convert a single field
867  }
868  return (_Dest);
869  }
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &, _Elem, const tm *_Pt, char _Specifier, char _Modifier= '\0') const
Definition: xloctime:921
wchar_t _Elem
Definition: xloctime:823
#define _USE(loc, fac)
Definition: xlocale:547
locale __CLR_OR_THIS_CALL getloc() const
Definition: xiosbase:433
#define _DEBUG_POINTER(first)
Definition: xutility:819
ctype< _Elem > _Ctype
Definition: xloctime:826
template<class _OutIt >
_OutIt __CLR_OR_THIS_CALL time_put< wchar_t, _OutIt >::put ( _OutIt  _Dest,
ios_base _Iosbase,
_Elem  _Fill,
const tm *  _Pt,
char  _Specifier,
char  _Modifier = '\0' 
) const
inline
874  { // put formatted time from _Pt to _Dest for _Specifier/_Modifier
875  return (do_put(_Dest, _Iosbase, _Fill, _Pt, _Specifier, _Modifier));
876  }
virtual _OutIt __CLR_OR_THIS_CALL do_put(_OutIt _Dest, ios_base &, _Elem, const tm *_Pt, char _Specifier, char _Modifier= '\0') const
Definition: xloctime:921

Member Data Documentation

template<class _OutIt >
_Locinfo::_Timevec time_put< wchar_t, _OutIt >::_Tnames
private
template<class _OutIt >
__PURE_APPDOMAIN_GLOBAL locale::id time_put< wchar_t, _OutIt >::id
static

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