libstdc++: std::moneypunct_byname< _CharT, _Intl > Class Template Reference

libstdc++

std::moneypunct_byname< _CharT, _Intl > Class Template Reference

`#include <locale_facets_nonio.h>`

Inheritance diagram for std::moneypunct_byname< _CharT, _Intl >:
[legend]

## Public Types
enum | { _S_minus , _S_zero , _S_end }
typedef __moneypunct_cache< _CharT, _Intl > | __cache_type
typedef _CharT | char_type
enum | part { none , space , symbol , sign , value }
typedef basic_string< _CharT > | string_type

## Public Member Functions
| moneypunct_byname (const char *__s, size_t __refs=0)
| moneypunct_byname (const string &__s, size_t __refs=0)
string_type | curr_symbol () const
char_type | decimal_point () const
int | frac_digits () const
string | grouping () const
string_type | negative_sign () const
string_type | positive_sign () const
char_type | thousands_sep () const
pattern | pos_format () const
pattern | neg_format () const

## Static Public Member Functions
static pattern | _S_construct_pattern (char __precedes, char __space, char __posn) throw ()

## Static Public Attributes
static const char * | _S_atoms
static const pattern | _S_default_pattern
static locale::id | id
static const bool | intl

## Protected Member Functions
void | _M_initialize_moneypunct (__c_locale __cloc=0, const char *__name=0)
void | _M_initialize_moneypunct (__c_locale, const char *)
void | _M_initialize_moneypunct (__c_locale, const char *)
void | _M_initialize_moneypunct (__c_locale, const char *)
void | _M_initialize_moneypunct (__c_locale, const char *)
virtual string_type | do_curr_symbol () const
virtual char_type | do_decimal_point () const
virtual int | do_frac_digits () const
virtual string | do_grouping () const
virtual pattern | do_neg_format () const
virtual string_type | do_negative_sign () const
virtual pattern | do_pos_format () const
virtual string_type | do_positive_sign () const
virtual char_type | do_thousands_sep () const

## Static Protected Member Functions
static __c_locale | _S_clone_c_locale (__c_locale &__cloc) throw ()
static void | _S_create_c_locale (__c_locale &__cloc, const char *__s, __c_locale __old=0)
static void | _S_destroy_c_locale (__c_locale &__cloc)
static __c_locale | _S_get_c_locale ()
static const char * | _S_get_c_name () throw ()
static __c_locale | _S_lc_ctype_c_locale (__c_locale __cloc, const char *__s)

## Detailed Description

template<typename _CharT, bool _Intl>
class std::moneypunct_byname< _CharT, _Intl >

class moneypunct_byname [22.2.6.4].

Definition at line 1454 of file locale_facets_nonio.h.

## Member Typedef Documentation

## ◆ __cache_type

template<typename _CharT, bool _Intl>

typedef __moneypunct_cache<_CharT, _Intl> std::moneypunct< _CharT, _Intl >::__cache_type
| inherited

Definition at line 1073 of file locale_facets_nonio.h.

## ◆ char_type

template<typename _CharT, bool _Intl>

typedef _CharT std::moneypunct_byname< _CharT, _Intl >::char_type

Definition at line 1457 of file locale_facets_nonio.h.

## ◆ string_type

template<typename _CharT, bool _Intl>

typedef basic_string<_CharT> std::moneypunct_byname< _CharT, _Intl >::string_type

Definition at line 1458 of file locale_facets_nonio.h.

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum
| inherited

Definition at line 976 of file locale_facets_nonio.h.

## ◆ part

enum std::money_base::part
| inherited

Definition at line 971 of file locale_facets_nonio.h.

## Constructor & Destructor Documentation

## ◆ moneypunct_byname() [1/2]

template<typename _CharT, bool _Intl>

std::moneypunct_byname< _CharT, _Intl >::moneypunct_byname | ( | const char * | __s,
|  | size_t | __refs = 0 )
| inlineexplicit

Definition at line 1463 of file locale_facets_nonio.h.

## ◆ moneypunct_byname() [2/2]

template<typename _CharT, bool _Intl>

std::moneypunct_byname< _CharT, _Intl >::moneypunct_byname | ( | const string & | __s,
|  | size_t | __refs = 0 )
| inlineexplicit

Definition at line 1478 of file locale_facets_nonio.h.

## ◆ ~moneypunct_byname()

template<typename _CharT, bool _Intl>

virtual std::moneypunct_byname< _CharT, _Intl >::~moneypunct_byname | ( |  | ) |
| inlineprotectedvirtual

Definition at line 1484 of file locale_facets_nonio.h.

## Member Function Documentation

## ◆ curr_symbol()

template<typename _CharT, bool _Intl>

string_type std::moneypunct< _CharT, _Intl >::curr_symbol | ( |  | ) | const
| inlineinherited

Return currency symbol string.

This function returns a string_type to use as a currency symbol. It does so by returning returning moneypunct<char_type>::do_curr_symbol().

Returns
  string_type representing a currency symbol.

Definition at line 1191 of file locale_facets_nonio.h.

References do_curr_symbol().

## ◆ decimal_point()

template<typename _CharT, bool _Intl>

char_type std::moneypunct< _CharT, _Intl >::decimal_point | ( |  | ) | const
| inlineinherited

Return decimal point character.

This function returns a char_type to use as a decimal point. It does so by returning returning moneypunct<char_type>::do_decimal_point().

Returns
  char_type representing a decimal point.

Definition at line 1135 of file locale_facets_nonio.h.

References do_decimal_point().

## ◆ do_curr_symbol()

template<typename _CharT, bool _Intl>

virtual string_type std::moneypunct< _CharT, _Intl >::do_curr_symbol | ( |  | ) | const
| inlineprotectedvirtualinherited

Return currency symbol string.

This function returns a string_type to use as a currency symbol. This function is a hook for derived classes to change the value returned.

See also
  curr_symbol() for details.

Returns
  string_type representing a currency symbol.

Definition at line 1337 of file locale_facets_nonio.h.

Referenced by curr_symbol().

## ◆ do_decimal_point()

template<typename _CharT, bool _Intl>

virtual char_type std::moneypunct< _CharT, _Intl >::do_decimal_point | ( |  | ) | const
| inlineprotectedvirtualinherited

Return decimal point character.

Returns a char_type to use as a decimal point. This function is a hook for derived classes to change the value returned.

Returns
  char_type representing a decimal point.

Definition at line 1299 of file locale_facets_nonio.h.

Referenced by decimal_point().

## ◆ do_frac_digits()

template<typename _CharT, bool _Intl>

virtual int std::moneypunct< _CharT, _Intl >::do_frac_digits | ( |  | ) | const
| inlineprotectedvirtualinherited

Return number of digits in fraction.

This function returns the exact number of digits that make up the fractional part of a money amount. This function is a hook for derived classes to change the value returned.

See also
  frac_digits() for details.

Returns
  Number of digits in amount fraction.

Definition at line 1377 of file locale_facets_nonio.h.

Referenced by frac_digits().

## ◆ do_grouping()

template<typename _CharT, bool _Intl>

virtual string std::moneypunct< _CharT, _Intl >::do_grouping | ( |  | ) | const
| inlineprotectedvirtualinherited

Return grouping specification.

Returns a string representing groupings for the integer part of a number. This function is a hook for derived classes to change the value returned.

See also
  grouping() for details.

Returns
  String representing grouping specification.

Definition at line 1324 of file locale_facets_nonio.h.

Referenced by grouping().

## ◆ do_neg_format()

template<typename _CharT, bool _Intl>

virtual pattern std::moneypunct< _CharT, _Intl >::do_neg_format | ( |  | ) | const
| inlineprotectedvirtualinherited

Return pattern for money values.

This function returns a pattern describing the formatting of a negative valued money amount. This function is a hook for derived classes to change the value returned.

See also
  neg_format() for details.

Returns
  Pattern for money values.

Definition at line 1405 of file locale_facets_nonio.h.

Referenced by neg_format().

## ◆ do_negative_sign()

template<typename _CharT, bool _Intl>

virtual string_type std::moneypunct< _CharT, _Intl >::do_negative_sign | ( |  | ) | const
| inlineprotectedvirtualinherited

Return negative sign string.

This function returns a string_type to use as a sign for negative amounts. This function is a hook for derived classes to change the value returned.

See also
  negative_sign() for details.

Returns
  string_type representing a negative sign.

Definition at line 1363 of file locale_facets_nonio.h.

Referenced by negative_sign().

## ◆ do_pos_format()

template<typename _CharT, bool _Intl>

virtual pattern std::moneypunct< _CharT, _Intl >::do_pos_format | ( |  | ) | const
| inlineprotectedvirtualinherited

Return pattern for money values.

This function returns a pattern describing the formatting of a positive valued money amount. This function is a hook for derived classes to change the value returned.

See also
  pos_format() for details.

Returns
  Pattern for money values.

Definition at line 1391 of file locale_facets_nonio.h.

Referenced by pos_format().

## ◆ do_positive_sign()

template<typename _CharT, bool _Intl>

virtual string_type std::moneypunct< _CharT, _Intl >::do_positive_sign | ( |  | ) | const
| inlineprotectedvirtualinherited

Return positive sign string.

This function returns a string_type to use as a sign for positive amounts. This function is a hook for derived classes to change the value returned.

See also
  positive_sign() for details.

Returns
  string_type representing a positive sign.

Definition at line 1350 of file locale_facets_nonio.h.

Referenced by positive_sign().

## ◆ do_thousands_sep()

template<typename _CharT, bool _Intl>

virtual char_type std::moneypunct< _CharT, _Intl >::do_thousands_sep | ( |  | ) | const
| inlineprotectedvirtualinherited

Return thousands separator character.

Returns a char_type to use as a thousands separator. This function is a hook for derived classes to change the value returned.

Returns
  char_type representing a thousands separator.

Definition at line 1311 of file locale_facets_nonio.h.

Referenced by thousands_sep().

## ◆ frac_digits()

template<typename _CharT, bool _Intl>

int std::moneypunct< _CharT, _Intl >::frac_digits | ( |  | ) | const
| inlineinherited

Return number of digits in fraction.

This function returns the exact number of digits that make up the fractional part of a money amount. It does so by returning returning moneypunct<char_type>::do_frac_digits().

The fractional part of a money amount is optional. But if it is present, there must be frac_digits() digits.

Returns
  Number of digits in amount fraction.

Definition at line 1241 of file locale_facets_nonio.h.

References do_frac_digits().

## ◆ grouping()

template<typename _CharT, bool _Intl>

string std::moneypunct< _CharT, _Intl >::grouping | ( |  | ) | const
| inlineinherited

Return grouping specification.

This function returns a string representing groupings for the integer part of an amount. Groupings indicate where thousands separators should be inserted.

Each char in the return string is interpret as an integer rather than a character. These numbers represent the number of digits in a group. The first char in the string represents the number of digits in the least significant group. If a char is negative, it indicates an unlimited number of digits for the group. If more chars from the string are required to group a number, the last char is used repeatedly.

For example, if the grouping() returns `\003\002` and is applied to the number 123456789, this corresponds to 12,34,56,789. Note that if the string was `32`, this would put more than 50 digits into the least significant group if the character set is ASCII.

The string is returned by calling moneypunct<char_type>::do_grouping().

Returns
  string representing grouping specification.

Definition at line 1178 of file locale_facets_nonio.h.

References do_grouping().

## ◆ neg_format()

template<typename _CharT, bool _Intl>

pattern std::moneypunct< _CharT, _Intl >::neg_format | ( |  | ) | const
| inlineinherited

Return pattern for money values.

This function returns a pattern describing the formatting of a positive or negative valued money amount. It does so by returning returning moneypunct<char_type>::do_pos_format() or moneypunct<char_type>::do_neg_format().

The pattern has 4 fields describing the ordering of symbol, sign, value, and none or space. There must be one of each in the pattern. The none and space enums may not appear in the first field and space may not appear in the final field.

The parts of a money string must appear in the order indicated by the fields of the pattern. The symbol field indicates that the value of curr_symbol() may be present. The sign field indicates that the value of positive_sign() or negative_sign() must be present. The value field indicates that the absolute value of the money amount is present. none indicates 0 or more whitespace characters, except at the end, where it permits no whitespace. space indicates that 1 or more whitespace characters must be present.

For example, for the US locale and pos_format() pattern {symbol,sign,value,none}, curr_symbol() == '$' positive_sign() == '+', and value 10.01, and options set to force the symbol, the corresponding string is `$+10.01`.

Returns
  Pattern for money values.

Definition at line 1281 of file locale_facets_nonio.h.

References do_neg_format().

## ◆ negative_sign()

template<typename _CharT, bool _Intl>

string_type std::moneypunct< _CharT, _Intl >::negative_sign | ( |  | ) | const
| inlineinherited

Return negative sign string.

This function returns a string_type to use as a sign for negative amounts. It does so by returning returning moneypunct<char_type>::do_negative_sign().

If the return value contains more than one character, the first character appears in the position indicated by neg_format() and the remainder appear at the end of the formatted string.

Returns
  string_type representing a negative sign.

Definition at line 1225 of file locale_facets_nonio.h.

References do_negative_sign().

## ◆ pos_format()

template<typename _CharT, bool _Intl>

pattern std::moneypunct< _CharT, _Intl >::pos_format | ( |  | ) | const
| inlineinherited

Return pattern for money values.

This function returns a pattern describing the formatting of a positive or negative valued money amount. It does so by returning returning moneypunct<char_type>::do_pos_format() or moneypunct<char_type>::do_neg_format().

The pattern has 4 fields describing the ordering of symbol, sign, value, and none or space. There must be one of each in the pattern. The none and space enums may not appear in the first field and space may not appear in the final field.

The parts of a money string must appear in the order indicated by the fields of the pattern. The symbol field indicates that the value of curr_symbol() may be present. The sign field indicates that the value of positive_sign() or negative_sign() must be present. The value field indicates that the absolute value of the money amount is present. none indicates 0 or more whitespace characters, except at the end, where it permits no whitespace. space indicates that 1 or more whitespace characters must be present.

For example, for the US locale and pos_format() pattern {symbol,sign,value,none}, curr_symbol() == '$' positive_sign() == '+', and value 10.01, and options set to force the symbol, the corresponding string is `$+10.01`.

Returns
  Pattern for money values.

Definition at line 1277 of file locale_facets_nonio.h.

References do_pos_format().

## ◆ positive_sign()

template<typename _CharT, bool _Intl>

string_type std::moneypunct< _CharT, _Intl >::positive_sign | ( |  | ) | const
| inlineinherited

Return positive sign string.

This function returns a string_type to use as a sign for positive amounts. It does so by returning returning moneypunct<char_type>::do_positive_sign().

If the return value contains more than one character, the first character appears in the position indicated by pos_format() and the remainder appear at the end of the formatted string.

Returns
  string_type representing a positive sign.

Definition at line 1208 of file locale_facets_nonio.h.

References do_positive_sign().

## ◆ thousands_sep()

template<typename _CharT, bool _Intl>

char_type std::moneypunct< _CharT, _Intl >::thousands_sep | ( |  | ) | const
| inlineinherited

Return thousands separator character.

This function returns a char_type to use as a thousands separator. It does so by returning returning moneypunct<char_type>::do_thousands_sep().

Returns
  char_type representing a thousands separator.

Definition at line 1148 of file locale_facets_nonio.h.

References do_thousands_sep().

## Member Data Documentation

## ◆ _S_atoms

const char* std::money_base::_S_atoms
| staticinherited

Definition at line 985 of file locale_facets_nonio.h.

## ◆ _S_default_pattern

const pattern std::money_base::_S_default_pattern
| staticinherited

Definition at line 974 of file locale_facets_nonio.h.

## ◆ id

template<typename _CharT, bool _Intl>

locale::id std::moneypunct< _CharT, _Intl >::id
| staticinherited

Numpunct facet id.

Definition at line 1083 of file locale_facets_nonio.h.

## ◆ intl

template<typename _CharT, bool _Intl>

const bool std::moneypunct_byname< _CharT, _Intl >::intl
| static

Definition at line 1460 of file locale_facets_nonio.h.

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

- locale_facets_nonio.h