STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
_Mpunct< _Elem > Class Template Reference
Inheritance diagram for _Mpunct< _Elem >:
money_base locale::facet _Facet_base moneypunct< _Elem, _Intl > moneypunct_byname< _Elem, _Intl >

Public Types

typedef _Elem char_type
 
typedef basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > string_type
 
- Public Types inherited from money_base
enum  {
  symbol = '$', sign = '+', space = ' ', value = 'v',
  none = 'x'
}
 
typedef int part
 

Public Member Functions

_Elem decimal_point () const
 
_Elem thousands_sep () const
 
string grouping () const
 
string_type curr_symbol () const
 
string_type positive_sign () const
 
string_type negative_sign () const
 
int frac_digits () const
 
pattern pos_format () const
 
pattern neg_format () const
 
 _Mpunct (size_t _Refs, bool _Intl)
 
 _Mpunct (const _Locinfo &_Lobj, size_t _Refs, bool _Intl, bool _Isdef=false)
 
- Public Member Functions inherited from money_base
 money_base (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
 

Protected Member Functions

 _Mpunct (const char *_Locname, size_t _Refs, bool _Intl, bool _Isdef=false)
 
virtual __CLR_OR_THIS_CALL ~_Mpunct () _NOEXCEPT
 
template<class _Elem2 >
void _Getvals (_Elem2, const lconv *_Ptr)
 
template<>
void _Getvals (wchar_t, const lconv *_Ptr)
 
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_curr_symbol () const
 
virtual string_type __CLR_OR_THIS_CALL do_positive_sign () const
 
virtual string_type __CLR_OR_THIS_CALL do_negative_sign () const
 
virtual int __CLR_OR_THIS_CALL do_frac_digits () const
 
virtual pattern __CLR_OR_THIS_CALL do_pos_format () const
 
virtual pattern __CLR_OR_THIS_CALL do_neg_format () 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 _Makpat (pattern &_Pattern, unsigned int _Sepbyspace, unsigned int _Symbolprecedes, unsigned int _Signposition)
 
void _Tidy ()
 

Private Attributes

const char * _Grouping
 
_Elem _Decimalpoint
 
_Elem _Kseparator
 
const _Elem * _Currencysign
 
const _Elem * _Plussign
 
const _Elem * _Minussign
 
int _Fracdigits
 
pattern _Plusformat
 
pattern _Minusformat
 
bool _International
 
_Locinfo::_Cvtvec _Cvt
 

Additional Inherited Members

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

Member Typedef Documentation

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

Constructor & Destructor Documentation

template<class _Elem >
_Mpunct< _Elem >::_Mpunct ( size_t  _Refs,
bool  _Intl 
)
inlineexplicit
93  { // construct from current locale
94  _BEGIN_LOCINFO(_Lobj)
95  _Init(_Lobj);
96  _END_LOCINFO()
97  }
money_base(size_t _Refs=0)
Definition: xlocmon:30
void _Init(const _Locinfo &_Lobj, bool _Isdef=false)
Definition: xlocmon:149
bool _International
Definition: xlocmon:267
_Atomic_counter_t _Refs
Definition: xlocale:157
template<class _Elem >
_Mpunct< _Elem >::_Mpunct ( const _Locinfo _Lobj,
size_t  _Refs,
bool  _Intl,
bool  _Isdef = false 
)
inline
101  : money_base(_Refs), _International(_Intl)
102  { // construct from specified locale
103  _Init(_Lobj, _Isdef);
104  }
money_base(size_t _Refs=0)
Definition: xlocmon:30
void _Init(const _Locinfo &_Lobj, bool _Isdef=false)
Definition: xlocmon:149
bool _International
Definition: xlocmon:267
_Atomic_counter_t _Refs
Definition: xlocale:157
template<class _Elem >
_Mpunct< _Elem >::_Mpunct ( const char *  _Locname,
size_t  _Refs,
bool  _Intl,
bool  _Isdef = false 
)
inlineprotected
109  : money_base(_Refs), _International(_Intl)
110  { // construct from specified locale
111  _BEGIN_LOCINFO(_Lobj(_Locname))
112  _Init(_Lobj, _Isdef);
113  _END_LOCINFO()
114  }
money_base(size_t _Refs=0)
Definition: xlocmon:30
void _Init(const _Locinfo &_Lobj, bool _Isdef=false)
Definition: xlocmon:149
bool _International
Definition: xlocmon:267
_Atomic_counter_t _Refs
Definition: xlocale:157
template<class _Elem >
virtual __CLR_OR_THIS_CALL _Mpunct< _Elem >::~_Mpunct ( )
inlineprotectedvirtual
117  { // destroy the object
118  _Tidy();
119  }
void _Tidy()
Definition: xlocmon:250

Member Function Documentation

template<class _Elem >
template<class _Elem2 >
void _Mpunct< _Elem >::_Getvals ( _Elem2  ,
const lconv _Ptr 
)
inlineprotected
123  { // get values
125  ? _Ptr->int_curr_symbol : _Ptr->currency_symbol, _Cvt);
126  _Plussign = _MAKLOCSTR(_Elem2, 4 < (unsigned int)_Ptr->p_sign_posn
127  ? "" : _Ptr->positive_sign, _Cvt);
128  _Minussign = _MAKLOCSTR(_Elem2, 4 < (unsigned int)_Ptr->n_sign_posn
129  ? "-" : _Ptr->negative_sign, _Cvt);
130  _Decimalpoint = _MAKLOCCHR(_Elem2, _Ptr->mon_decimal_point[0], _Cvt);
131  _Kseparator = _MAKLOCCHR(_Elem2, _Ptr->mon_thousands_sep[0], _Cvt);
132  }
char * mon_thousands_sep
Definition: locale.h:62
char * mon_decimal_point
Definition: locale.h:61
const _Elem * _Currencysign
Definition: xlocmon:261
char p_sign_posn
Definition: locale.h:72
char * negative_sign
Definition: locale.h:65
const _Elem * _Plussign
Definition: xlocmon:262
const _Elem * _Minussign
Definition: xlocmon:263
char n_sign_posn
Definition: locale.h:73
char * positive_sign
Definition: locale.h:64
bool _International
Definition: xlocmon:267
char * currency_symbol
Definition: locale.h:60
_Elem _Decimalpoint
Definition: xlocmon:259
char * int_curr_symbol
Definition: locale.h:59
#define _MAKLOCCHR(Elem, chr, cvt)
Definition: xlocale:688
_Locinfo::_Cvtvec _Cvt
Definition: xlocmon:269
#define _MAKLOCSTR(Elem, str, cvt)
Definition: xlocale:721
_Elem _Kseparator
Definition: xlocmon:260
template<class _Elem >
template<>
void _Mpunct< _Elem >::_Getvals ( wchar_t  ,
const lconv _Ptr 
)
inlineprotected
136  { // get values
137  _Currencysign = (const _Elem *)_Maklocwcs(_International
138  ? _Ptr->_W_int_curr_symbol : _Ptr->_W_currency_symbol);
139  _Plussign = (const _Elem *)_Maklocwcs(
140  4 < (unsigned int)_Ptr->p_sign_posn
141  ? L"" : _Ptr->_W_positive_sign);
142  _Minussign = (const _Elem *)_Maklocwcs(
143  4 < (unsigned int)_Ptr->n_sign_posn
144  ? L"-" : _Ptr->_W_negative_sign);
145  _Decimalpoint = (_Elem)_Ptr->_W_mon_decimal_point[0];
146  _Kseparator = (_Elem)_Ptr->_W_mon_thousands_sep[0];
147  }
wchar_t * _W_currency_symbol
Definition: locale.h:77
const _Elem * _Currencysign
Definition: xlocmon:261
char p_sign_posn
Definition: locale.h:72
wchar_t * _Maklocwcs(const wchar_t *_Ptr)
Definition: xlocnum:62
const _Elem * _Plussign
Definition: xlocmon:262
wchar_t * _W_positive_sign
Definition: locale.h:80
const _Elem * _Minussign
Definition: xlocmon:263
char n_sign_posn
Definition: locale.h:73
bool _International
Definition: xlocmon:267
_Elem _Decimalpoint
Definition: xlocmon:259
wchar_t * _W_mon_thousands_sep
Definition: locale.h:79
wchar_t * _W_negative_sign
Definition: locale.h:81
wchar_t * _W_int_curr_symbol
Definition: locale.h:76
wchar_t * _W_mon_decimal_point
Definition: locale.h:78
_Elem _Kseparator
Definition: xlocmon:260
template<class _Elem >
void _Mpunct< _Elem >::_Init ( const _Locinfo _Lobj,
bool  _Isdef = false 
)
inlineprotected
150  { // initialize from _Lobj
151  _Cvt = _Lobj._Getcvt();
152  const lconv *_Ptr = _Lobj._Getlconv();
153 
154  _Grouping = 0;
155  _Currencysign = 0;
156  _Plussign = 0;
157  _Minussign = 0;
158 
159  _TRY_BEGIN
160  _Grouping = _MAKLOCSTR(char, _Ptr->mon_grouping, _Cvt);
161  _Getvals((_Elem)0, _Ptr);
162  _CATCH_ALL
163  _Tidy();
164  _RERAISE;
165  _CATCH_END
166 
168  : _Ptr->frac_digits;
169  if (_Fracdigits < 0 || CHAR_MAX <= _Fracdigits)
170  _Fracdigits = 0;
171 
173  _Ptr->p_cs_precedes, _Ptr->p_sign_posn);
175  _Ptr->n_cs_precedes, _Ptr->n_sign_posn);
176 
177  if (_Isdef)
178  { // apply defaults for required facets
179  memcpy(&_Plusformat, "$+xv", 4);
180  memcpy(&_Minusformat, "$+xv", 4);
181  }
182  }
pattern _Minusformat
Definition: xlocmon:266
int _Fracdigits
Definition: xlocmon:264
const lconv *__CLR_OR_THIS_CALL _Getlconv() const
Definition: xlocinfo:125
const _Elem * _Currencysign
Definition: xlocmon:261
char p_sign_posn
Definition: locale.h:72
#define _TRY_BEGIN
Definition: xstddef:60
const _Elem * _Plussign
Definition: xlocmon:262
#define _CATCH_END
Definition: xstddef:63
_Cvtvec __CLR_OR_THIS_CALL _Getcvt() const
Definition: xlocinfo:120
pattern _Plusformat
Definition: xlocmon:265
char * mon_grouping
Definition: locale.h:63
const _Elem * _Minussign
Definition: xlocmon:263
const char * _Grouping
Definition: xlocmon:258
char int_frac_digits
Definition: locale.h:66
char n_sep_by_space
Definition: locale.h:71
Definition: locale.h:55
char n_sign_posn
Definition: locale.h:73
bool _International
Definition: xlocmon:267
void _Getvals(_Elem2, const lconv *_Ptr)
Definition: xlocmon:122
void _Tidy()
Definition: xlocmon:250
void _Makpat(pattern &_Pattern, unsigned int _Sepbyspace, unsigned int _Symbolprecedes, unsigned int _Signposition)
Definition: xlocmon:230
char p_sep_by_space
Definition: locale.h:69
char p_cs_precedes
Definition: locale.h:68
#define _CATCH_ALL
Definition: xstddef:62
_Locinfo::_Cvtvec _Cvt
Definition: xlocmon:269
#define CHAR_MAX
Definition: limits.h:29
#define _MAKLOCSTR(Elem, str, cvt)
Definition: xlocale:721
#define _RERAISE
Definition: xstddef:74
char frac_digits
Definition: locale.h:67
char n_cs_precedes
Definition: locale.h:70
template<class _Elem >
void _Mpunct< _Elem >::_Makpat ( pattern &  _Pattern,
unsigned int  _Sepbyspace,
unsigned int  _Symbolprecedes,
unsigned int  _Signposition 
)
inlineprivate
232  { // make format pattern from locale information
233  const char *_Ptr = _International || 2 < _Sepbyspace
234  || 1 < _Symbolprecedes || 4 < _Signposition
235  ? "$+xv" // international or bad parameters
236  : &(
237  "+v$x" "+v$x" "v$+x" "v+$x" "v$+x"
238  "+$vx" "+$vx" "$v+x" "+$vx" "$+vx"
239  "+v $" "+v $" "v $+" "v +$" "v $+"
240  "+$ v" "+$ v" "$ v+" "+$ v" "$+ v"
241  "+xv$" "+ v$" "v$ +" "v+ $" "v$ +"
242  "+x$v" "+ $v" "$v +" "+ $v" "$ +v")
243  [_Signposition * 4 // pick even/odd column
244  + _Symbolprecedes * 20 // pick even/odd row
245  + _Sepbyspace * 40]; // pick first/second/third group
246 
247  _CRT_SECURE_MEMCPY(_Pattern.field, sizeof (_Pattern.field), _Ptr, 4);
248  }
bool _International
Definition: xlocmon:267
#define _CRT_SECURE_MEMCPY(dest, destsize, source, count)
Definition: yvals.h:356
template<class _Elem >
void _Mpunct< _Elem >::_Tidy ( )
inlineprivate
251  { // free all storage
252  _DELETE_CRT_VEC((void *)_Grouping);
254  _DELETE_CRT_VEC((void *)_Plussign);
255  _DELETE_CRT_VEC((void *)_Minussign);
256  }
const _Elem * _Currencysign
Definition: xlocmon:261
const _Elem * _Plussign
Definition: xlocmon:262
const _Elem * _Minussign
Definition: xlocmon:263
const char * _Grouping
Definition: xlocmon:258
#define _DELETE_CRT_VEC(ptr)
Definition: xdebug:71
template<class _Elem >
string_type _Mpunct< _Elem >::curr_symbol ( ) const
inline
62  { // return currency symbol string
63  return (do_curr_symbol());
64  }
virtual string_type __CLR_OR_THIS_CALL do_curr_symbol() const
Definition: xlocmon:199
template<class _Elem >
_Elem _Mpunct< _Elem >::decimal_point ( ) const
inline
47  { // return decimal point
48  return (do_decimal_point());
49  }
virtual _Elem __CLR_OR_THIS_CALL do_decimal_point() const
Definition: xlocmon:184
template<class _Elem >
virtual string_type __CLR_OR_THIS_CALL _Mpunct< _Elem >::do_curr_symbol ( ) const
inlineprotectedvirtual
200  { // return currency symbol string
201  return (string_type(_Currencysign));
202  }
const _Elem * _Currencysign
Definition: xlocmon:261
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > string_type
Definition: xlocmon:44
template<class _Elem >
virtual _Elem __CLR_OR_THIS_CALL _Mpunct< _Elem >::do_decimal_point ( ) const
inlineprotectedvirtual
185  { // return decimal point
186  return (_Decimalpoint);
187  }
_Elem _Decimalpoint
Definition: xlocmon:259
template<class _Elem >
virtual int __CLR_OR_THIS_CALL _Mpunct< _Elem >::do_frac_digits ( ) const
inlineprotectedvirtual
215  { // return number of fraction digits
216  return (_Fracdigits);
217  }
int _Fracdigits
Definition: xlocmon:264
template<class _Elem >
virtual string __CLR_OR_THIS_CALL _Mpunct< _Elem >::do_grouping ( ) const
inlineprotectedvirtual
195  { // return grouping string
196  return (string(_Grouping));
197  }
const char * _Grouping
Definition: xlocmon:258
template<class _Elem >
virtual pattern __CLR_OR_THIS_CALL _Mpunct< _Elem >::do_neg_format ( ) const
inlineprotectedvirtual
225  { // return format for negative values
226  return (_Minusformat);
227  }
pattern _Minusformat
Definition: xlocmon:266
template<class _Elem >
virtual string_type __CLR_OR_THIS_CALL _Mpunct< _Elem >::do_negative_sign ( ) const
inlineprotectedvirtual
210  { // return minus sign
211  return (string_type(_Minussign));
212  }
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > string_type
Definition: xlocmon:44
const _Elem * _Minussign
Definition: xlocmon:263
template<class _Elem >
virtual pattern __CLR_OR_THIS_CALL _Mpunct< _Elem >::do_pos_format ( ) const
inlineprotectedvirtual
220  { // return format for positive values
221  return (_Plusformat);
222  }
pattern _Plusformat
Definition: xlocmon:265
template<class _Elem >
virtual string_type __CLR_OR_THIS_CALL _Mpunct< _Elem >::do_positive_sign ( ) const
inlineprotectedvirtual
205  { // return plus sign
206  return (string_type(_Plussign));
207  }
basic_string< _Elem, char_traits< _Elem >, allocator< _Elem > > string_type
Definition: xlocmon:44
const _Elem * _Plussign
Definition: xlocmon:262
template<class _Elem >
virtual _Elem __CLR_OR_THIS_CALL _Mpunct< _Elem >::do_thousands_sep ( ) const
inlineprotectedvirtual
190  { // return thousands separator
191  return (_Kseparator);
192  }
_Elem _Kseparator
Definition: xlocmon:260
template<class _Elem >
int _Mpunct< _Elem >::frac_digits ( ) const
inline
77  { // return number of fraction digits
78  return (do_frac_digits());
79  }
virtual int __CLR_OR_THIS_CALL do_frac_digits() const
Definition: xlocmon:214
template<class _Elem >
string _Mpunct< _Elem >::grouping ( ) const
inline
57  { // return grouping string
58  return (do_grouping());
59  }
virtual string __CLR_OR_THIS_CALL do_grouping() const
Definition: xlocmon:194
template<class _Elem >
pattern _Mpunct< _Elem >::neg_format ( ) const
inline
87  { // return format for negative values
88  return (do_neg_format());
89  }
virtual pattern __CLR_OR_THIS_CALL do_neg_format() const
Definition: xlocmon:224
template<class _Elem >
string_type _Mpunct< _Elem >::negative_sign ( ) const
inline
72  { // return minus sign
73  return (do_negative_sign());
74  }
virtual string_type __CLR_OR_THIS_CALL do_negative_sign() const
Definition: xlocmon:209
template<class _Elem >
pattern _Mpunct< _Elem >::pos_format ( ) const
inline
82  { // return format for positive values
83  return (do_pos_format());
84  }
virtual pattern __CLR_OR_THIS_CALL do_pos_format() const
Definition: xlocmon:219
template<class _Elem >
string_type _Mpunct< _Elem >::positive_sign ( ) const
inline
67  { // return plus sign
68  return (do_positive_sign());
69  }
virtual string_type __CLR_OR_THIS_CALL do_positive_sign() const
Definition: xlocmon:204
template<class _Elem >
_Elem _Mpunct< _Elem >::thousands_sep ( ) const
inline
52  { // return thousands separator
53  return (do_thousands_sep());
54  }
virtual _Elem __CLR_OR_THIS_CALL do_thousands_sep() const
Definition: xlocmon:189

Member Data Documentation

template<class _Elem >
const _Elem* _Mpunct< _Elem >::_Currencysign
private
template<class _Elem >
_Locinfo::_Cvtvec _Mpunct< _Elem >::_Cvt
private
template<class _Elem >
_Elem _Mpunct< _Elem >::_Decimalpoint
private
template<class _Elem >
int _Mpunct< _Elem >::_Fracdigits
private
template<class _Elem >
const char* _Mpunct< _Elem >::_Grouping
private
template<class _Elem >
bool _Mpunct< _Elem >::_International
private
template<class _Elem >
_Elem _Mpunct< _Elem >::_Kseparator
private
template<class _Elem >
pattern _Mpunct< _Elem >::_Minusformat
private
template<class _Elem >
const _Elem* _Mpunct< _Elem >::_Minussign
private
template<class _Elem >
pattern _Mpunct< _Elem >::_Plusformat
private
template<class _Elem >
const _Elem* _Mpunct< _Elem >::_Plussign
private

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