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
numpunct< _Elem > Class Template Reference
Inheritance diagram for numpunct< _Elem >:
locale::facet _Facet_base numpunct_byname< _Elem >

Public Types

typedef basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > string_type
 
typedef _Elem char_type
 

Public Member Functions

_Elem decimal_point () const
 
_Elem thousands_sep () const
 
string grouping () const
 
string_type falsename () const
 
string_type truename () const
 
 numpunct (size_t _Refs=0)
 
 numpunct (const _Locinfo &_Lobj, size_t _Refs=0, bool _Isdef=false)
 
- 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 _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

__PURE_APPDOMAIN_GLOBAL static _CRTIMP2_PURE locale::id id
 

Protected Member Functions

virtual __CLR_OR_THIS_CALL ~numpunct () _NOEXCEPT
 
 numpunct (const char *_Locname, size_t _Refs=0, bool _Isdef=false)
 
template<class _Elem2 >
void _Getvals (_Elem2, const lconv *_Ptr, _Locinfo::_Cvtvec _Cvt)
 
template<>
void _Getvals (wchar_t, const lconv *_Ptr, _Locinfo::_Cvtvec)
 
void _Init (const _Locinfo &_Lobj, bool _Isdef=false)
 
virtual _Elem __CLR_OR_THIS_CALL do_decimal_point () const
 
virtual _Elem __CLR_OR_THIS_CALL do_thousands_sep () const
 
virtual string __CLR_OR_THIS_CALL do_grouping () const
 
virtual string_type __CLR_OR_THIS_CALL do_falsename () const
 
virtual string_type __CLR_OR_THIS_CALL do_truename () 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

void _Tidy ()
 

Private Attributes

const char * _Grouping
 
_Elem _Dp
 
_Elem _Kseparator
 
const _Elem * _Falsename
 
const _Elem * _Truename
 

Member Typedef Documentation

template<class _Elem >
typedef _Elem numpunct< _Elem >::char_type
template<class _Elem >
typedef basic_string<_Elem, char_traits<_Elem>, allocator<_Elem> > numpunct< _Elem >::string_type

Constructor & Destructor Documentation

template<class _Elem >
numpunct< _Elem >::numpunct ( size_t  _Refs = 0)
inlineexplicit
109  { // construct from current locale
110  _BEGIN_LOCINFO(_Lobj)
111  _Init(_Lobj);
112  if (_Kseparator == 0)
113  _Kseparator = // NB: differs from "C" locale
114  _MAKLOCCHR(_Elem, ',', _Lobj._Getcvt());
115  _END_LOCINFO()
116  }
_Elem _Kseparator
Definition: xlocnum:225
Definition: xlocale:102
void _Init(const _Locinfo &_Lobj, bool _Isdef=false)
Definition: xlocnum:161
_Atomic_counter_t _Refs
Definition: xlocale:157
#define _MAKLOCCHR(Elem, chr, cvt)
Definition: xlocale:688
if(__pUnknown!=*__ppTargetUnknown)
Definition: vccorlib.h:394
_CRTIMP2_PURE _Cvtvec __CLRCALL_PURE_OR_CDECL _Getcvt()
template<class _Elem >
numpunct< _Elem >::numpunct ( const _Locinfo _Lobj,
size_t  _Refs = 0,
bool  _Isdef = false 
)
inline
120  { // construct from specified locale
121  _Init(_Lobj, _Isdef);
122  }
Definition: xlocale:102
void _Init(const _Locinfo &_Lobj, bool _Isdef=false)
Definition: xlocnum:161
_Atomic_counter_t _Refs
Definition: xlocale:157
template<class _Elem >
virtual __CLR_OR_THIS_CALL numpunct< _Elem >::~numpunct ( )
inlineprotectedvirtual
135  { // destroy the object
136  _Tidy();
137  }
void _Tidy()
Definition: xlocnum:216
template<class _Elem >
numpunct< _Elem >::numpunct ( const char *  _Locname,
size_t  _Refs = 0,
bool  _Isdef = false 
)
inlineprotected
141  { // construct from specified locale
142  _BEGIN_LOCINFO(_Lobj(_Locname))
143  _Init(_Lobj, _Isdef);
144  _END_LOCINFO()
145  }
Definition: xlocale:102
void _Init(const _Locinfo &_Lobj, bool _Isdef=false)
Definition: xlocnum:161
_Atomic_counter_t _Refs
Definition: xlocale:157

Member Function Documentation

template<class _Elem >
static size_t numpunct< _Elem >::_Getcat ( const locale::facet **  _Ppf = 0,
const locale _Ploc = 0 
)
inlinestatic
126  { // return locale category mask and construct standard facet
127  if (_Ppf != 0 && *_Ppf == 0)
128  *_Ppf = _NEW_CRT numpunct<_Elem>(
129  _Locinfo(_Ploc->c_str()), 0, true);
130  return (_X_NUMERIC);
131  }
#define _NEW_CRT
Definition: xdebug:69
Definition: xlocinfo:54
Definition: xlocnum:72
const char * c_str() const
Definition: xlocale:460
#define _X_NUMERIC
Definition: xlocinfo.h:41
template<class _Elem >
template<class _Elem2 >
void numpunct< _Elem >::_Getvals ( _Elem2  ,
const lconv _Ptr,
_Locinfo::_Cvtvec  _Cvt 
)
inlineprotected
149  { // get values
150  _Dp = _MAKLOCCHR(_Elem2, _Ptr->decimal_point[0], _Cvt);
151  _Kseparator = _MAKLOCCHR(_Elem2, _Ptr->thousands_sep[0], _Cvt);
152  }
char * decimal_point
Definition: locale.h:56
_Elem _Dp
Definition: xlocnum:224
_Elem _Kseparator
Definition: xlocnum:225
#define _MAKLOCCHR(Elem, chr, cvt)
Definition: xlocale:688
char * thousands_sep
Definition: locale.h:57
template<class _Elem >
template<>
void numpunct< _Elem >::_Getvals ( wchar_t  ,
const lconv _Ptr,
_Locinfo::_Cvtvec   
)
inlineprotected
156  { // get values
157  _Dp = (_Elem)_Ptr->_W_decimal_point[0];
158  _Kseparator = (_Elem)_Ptr->_W_thousands_sep[0];
159  }
wchar_t * _W_thousands_sep
Definition: locale.h:75
_Elem _Dp
Definition: xlocnum:224
_Elem _Kseparator
Definition: xlocnum:225
wchar_t * _W_decimal_point
Definition: locale.h:74
template<class _Elem >
void numpunct< _Elem >::_Init ( const _Locinfo _Lobj,
bool  _Isdef = false 
)
inlineprotected
162  { // initialize from _Lobj
163  const lconv *_Ptr = _Lobj._Getlconv();
164  _Locinfo::_Cvtvec _Cvt = _Lobj._Getcvt(); // conversion information
165 
166  _Grouping = 0;
167  _Falsename = 0;
168  _Truename = 0;
169 
170  _TRY_BEGIN
171  _Grouping = _MAKLOCSTR(char, _Isdef ? "" : _Ptr->grouping,
172  _Lobj._Getcvt());
173  _Falsename = _MAKLOCSTR(_Elem, _Lobj._Getfalse(), _Cvt);
174  _Truename = _MAKLOCSTR(_Elem, _Lobj._Gettrue(), _Cvt);
175  _CATCH_ALL
176  _Tidy();
177  _RERAISE;
178  _CATCH_END
179 
180  if (_Isdef)
181  { // apply defaults for required facets
182 // _Grouping = _MAKLOCSTR(char, "", _Cvt);
183  _Dp = _MAKLOCCHR(_Elem, '.', _Cvt);
184  _Kseparator = _MAKLOCCHR(_Elem, ',', _Cvt);
185  }
186  else
187  _Getvals((_Elem)0, _Ptr, _Cvt);
188  }
const lconv *__CLR_OR_THIS_CALL _Getlconv() const
Definition: xlocinfo:125
void _Tidy()
Definition: xlocnum:216
const char * _Grouping
Definition: xlocnum:223
#define _TRY_BEGIN
Definition: xstddef:60
char * grouping
Definition: locale.h:58
#define _CATCH_END
Definition: xstddef:63
_Cvtvec __CLR_OR_THIS_CALL _Getcvt() const
Definition: xlocinfo:120
void _Getvals(_Elem2, const lconv *_Ptr, _Locinfo::_Cvtvec _Cvt)
Definition: xlocnum:148
const char *__CLR_OR_THIS_CALL _Gettrue() const
Definition: xlocinfo:170
const char *__CLR_OR_THIS_CALL _Getfalse() const
Definition: xlocinfo:165
_Elem _Dp
Definition: xlocnum:224
Definition: locale.h:55
const _Elem * _Truename
Definition: xlocnum:227
_Elem _Kseparator
Definition: xlocnum:225
::_Cvtvec _Cvtvec
Definition: xlocinfo:59
#define _CATCH_ALL
Definition: xstddef:62
#define _MAKLOCCHR(Elem, chr, cvt)
Definition: xlocale:688
const _Elem * _Falsename
Definition: xlocnum:226
#define _MAKLOCSTR(Elem, str, cvt)
Definition: xlocale:721
#define _RERAISE
Definition: xstddef:74
template<class _Elem >
void numpunct< _Elem >::_Tidy ( )
inlineprivate
217  { // free all storage
218  _DELETE_CRT_VEC((void *)_Grouping);
219  _DELETE_CRT_VEC((void *)_Falsename);
220  _DELETE_CRT_VEC((void *)_Truename);
221  }
const char * _Grouping
Definition: xlocnum:223
const _Elem * _Truename
Definition: xlocnum:227
const _Elem * _Falsename
Definition: xlocnum:226
#define _DELETE_CRT_VEC(ptr)
Definition: xdebug:71
template<class _Elem >
_Elem numpunct< _Elem >::decimal_point ( ) const
inline
83  { // return decimal point
84  return (do_decimal_point());
85  }
virtual _Elem __CLR_OR_THIS_CALL do_decimal_point() const
Definition: xlocnum:190
template<class _Elem >
virtual _Elem __CLR_OR_THIS_CALL numpunct< _Elem >::do_decimal_point ( ) const
inlineprotectedvirtual
191  { // return decimal point
192  return (_Dp);
193  }
_Elem _Dp
Definition: xlocnum:224
template<class _Elem >
virtual string_type __CLR_OR_THIS_CALL numpunct< _Elem >::do_falsename ( ) const
inlineprotectedvirtual
206  { // return name for false
207  return (string_type(_Falsename));
208  }
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > string_type
Definition: xlocnum:77
const _Elem * _Falsename
Definition: xlocnum:226
template<class _Elem >
virtual string __CLR_OR_THIS_CALL numpunct< _Elem >::do_grouping ( ) const
inlineprotectedvirtual
201  { // return grouping string
202  return (string(_Grouping));
203  }
const char * _Grouping
Definition: xlocnum:223
template<class _Elem >
virtual _Elem __CLR_OR_THIS_CALL numpunct< _Elem >::do_thousands_sep ( ) const
inlineprotectedvirtual
196  { // return thousands separator
197  return (_Kseparator);
198  }
_Elem _Kseparator
Definition: xlocnum:225
template<class _Elem >
virtual string_type __CLR_OR_THIS_CALL numpunct< _Elem >::do_truename ( ) const
inlineprotectedvirtual
211  { // return name for true
212  return (string_type(_Truename));
213  }
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > string_type
Definition: xlocnum:77
const _Elem * _Truename
Definition: xlocnum:227
template<class _Elem >
string_type numpunct< _Elem >::falsename ( ) const
inline
98  { // return name for false
99  return (do_falsename());
100  }
virtual string_type __CLR_OR_THIS_CALL do_falsename() const
Definition: xlocnum:205
template<class _Elem >
string numpunct< _Elem >::grouping ( ) const
inline
93  { // return grouping string
94  return (do_grouping());
95  }
virtual string __CLR_OR_THIS_CALL do_grouping() const
Definition: xlocnum:200
template<class _Elem >
_Elem numpunct< _Elem >::thousands_sep ( ) const
inline
88  { // return thousands separator
89  return (do_thousands_sep());
90  }
virtual _Elem __CLR_OR_THIS_CALL do_thousands_sep() const
Definition: xlocnum:195
template<class _Elem >
string_type numpunct< _Elem >::truename ( ) const
inline
103  { // return name for true
104  return (do_truename());
105  }
virtual string_type __CLR_OR_THIS_CALL do_truename() const
Definition: xlocnum:210

Member Data Documentation

template<class _Elem >
_Elem numpunct< _Elem >::_Dp
private
template<class _Elem >
const _Elem* numpunct< _Elem >::_Falsename
private
template<class _Elem >
const char* numpunct< _Elem >::_Grouping
private
template<class _Elem >
_Elem numpunct< _Elem >::_Kseparator
private
template<class _Elem >
const _Elem* numpunct< _Elem >::_Truename
private
template<class _Elem >
__PURE_APPDOMAIN_GLOBAL locale::id numpunct< _Elem >::id
static

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