man std::money_put (Fonctions bibliothèques) - Facet for outputting monetary amounts.

NAME

std::money_put - Facet for outputting monetary amounts.

SYNOPSIS



#include <locale>

Inherits std::locale::facet.

Public Types



typedef CharT char_type

Public typedefs. typedef OutIter iter_type

Public typedefs. typedef basic_string< CharT > string_type

Public typedefs.

Public Member Functions

money_put (size_t __refs=0)

Constructor performs initialization. iter_type put (iter_type s, bool intl, ios_base &__io, char_type __fill, long double __units) const

Format and output a monetary value. iter_type put (iter_type s, bool intl, ios_base &__io, char_type __fill, const string_type &__digits) const

Format and output a monetary value.

Static Public Attributes

static locale::id id

Numpunct facet id.

Protected Member Functions

virtual ~money_put ()

Destructor. virtual iter_type do_put (iter_type s, bool intl, ios_base &__io, char_type __fill, long double __units) const

Format and output a monetary value. virtual iter_type do_put (iter_type s, bool intl, ios_base &__io, char_type __fill, const string_type &__digits) const

Format and output a monetary value. template<bool Intl> iter_type M_insert (iter_type s, ios_base &__io, char_type __fill, const string_type &__digits) const

Static Protected Member Functions

static c_locale S_get_c_locale ()

static const char * S_get_c_name ()

Friends

class locale::Impl

Detailed Description

template<typename CharT, typename OutIter> class std::money_put< CharT, OutIter >

Facet for outputting monetary amounts.

This facet encapsulates the code to format and output a monetary amount.

The money_put template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the money_put facet.

Definition at line 4097 of file locale.

Member Typedef Documentation

template<typename CharT, typename OutIter> typedef CharT std::money_put< CharT, OutIter >::char_type

Public typedefs.

Definition at line 4102 of file locale.

template<typename CharT, typename OutIter> typedef OutIter std::money_put< CharT, OutIter >::iter_type

Public typedefs.

Definition at line 4103 of file locale.

template<typename CharT, typename OutIter> typedef basic_string<CharT> std::money_put< CharT, OutIter >::string_type

Public typedefs.

Definition at line 4104 of file locale.

Constructor & Destructor Documentation

template<typename CharT, typename OutIter> std::money_put< CharT, OutIter >::money_put (size_t __refs = 0) [inline, explicit]

Constructor performs initialization.

This is the constructor provided by the standard.

Parameters: refs Passed to the base facet class.

Definition at line 4118 of file locale.

template<typename CharT, typename OutIter> virtual std::money_put< CharT, OutIter >::~money_put () [inline, protected, virtual]

Destructor.

Definition at line 4167 of file locale.

Member Function Documentation

template<typename CharT, typename OutIter> OutIter std::money_put< CharT, OutIter >::do_put (iter_type s, bool intl, ios_base & __io, char_type __fill, const string_type & __digits) const [protected, virtual]

Format and output a monetary value.

This function formats digits as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to s. For example, the string '1001' in a US locale would write '$10.01' to s.

This function is a hook for derived classes to change the value returned.

See also: put().

Parameters: s The stream to write to.

intl Parameter to use_facet<moneypunct<CharT,intl> >.

io Source of facets and io state.

fill char_type to use for padding.

units Place to store result of parsing.

Returns: Iterator after writing.

Definition at line 1704 of file locale_facets.tcc.

template<typename CharT, typename OutIter> OutIter std::money_put< CharT, OutIter >::do_put (iter_type s, bool intl, ios_base & __io, char_type __fill, long double __units) const [protected, virtual]

Format and output a monetary value.

This function formats units as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to s. For example, the value 1001 in a US locale would write '$10.01' to s.

This function is a hook for derived classes to change the value returned.

See also: put().

Parameters: s The stream to write to.

intl Parameter to use_facet<moneypunct<CharT,intl> >.

io Source of facets and io state.

fill char_type to use for padding.

units Place to store result of parsing.

Returns: Iterator after writing.

Definition at line 1665 of file locale_facets.tcc.

References std::ios_base::getloc(), and std::ctype_abstract_base< CharT >::widen().

Referenced by std::money_put< CharT, OutIter >::put().

template<typename CharT, typename OutIter> iter_type std::money_put< CharT, OutIter >::put (iter_type s, bool intl, ios_base & __io, char_type __fill, const string_type & __digits) const [inline]

Format and output a monetary value.

This function formats digits as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to s. For example, the string '1001' in a US locale would write '$10.01' to s.

This function works by returning the result of do_put().

Parameters: s The stream to write to.

intl Parameter to use_facet<moneypunct<CharT,intl> >.

io Source of facets and io state.

fill char_type to use for padding.

units Place to store result of parsing.

Returns: Iterator after writing.

Definition at line 4160 of file locale.

References std::money_put< CharT, OutIter >::do_put().

template<typename CharT, typename OutIter> iter_type std::money_put< CharT, OutIter >::put (iter_type s, bool intl, ios_base & __io, char_type __fill, long double __units) const [inline]

Format and output a monetary value.

This function formats units as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to s. For example, the value 1001 in a US locale would write '$10.01' to s.

This function works by returning the result of do_put().

Parameters: s The stream to write to.

intl Parameter to use_facet<moneypunct<CharT,intl> >.

io Source of facets and io state.

fill char_type to use for padding.

units Place to store result of parsing.

Returns: Iterator after writing.

Definition at line 4138 of file locale.

References std::money_put< CharT, OutIter >::do_put().

Member Data Documentation

template<typename CharT, typename OutIter> locale::id std::money_put< CharT, OutIter >::id [static]

Numpunct facet id.

Definition at line 4108 of file locale.

Author

Generated automatically by Doxygen for libstdc++-v3 Source from the source code.