SYNOPSIS

Inherits std::locale::facet.

Public Types

typedef _CharT char_type

typedef _InIter iter_type

typedef basic_string< _CharT > string_type

Public Member Functions

money_get (size_t __refs=0)

iter_type get (iter_type __s, iter_type __end, bool __intl, ios_base &__io, ios_base::iostate &__err, long double &__units) const

iter_type get (iter_type __s, iter_type __end, bool __intl, ios_base &__io, ios_base::iostate &__err, string_type &__digits) const

Static Public Attributes

static locale::id id

Protected Member Functions

virtual ~money_get ()

template<bool _Intl> iter_type _M_extract (iter_type __s, iter_type __end, ios_base &__io, ios_base::iostate &__err, string &__digits) const

virtual iter_type do_get (iter_type __s, iter_type __end, bool __intl, ios_base &__io, ios_base::iostate &__err, long double &__units) const

virtual iter_type do_get (iter_type __s, iter_type __end, bool __intl, ios_base &__io, ios_base::iostate &__err, string_type &__digits) 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, typename _InIter>singleton std::money_get< _CharT, _InIter >

Primary class template money_get.

This facet encapsulates the code to parse and return a monetary amount from a string.

The money_get 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_get facet.

Definition at line 1370 of file locale_facets_nonio.h.

Member Typedef Documentation

template<typename _CharT , typename _InIter > typedef _CharT \fBstd::money_get\fP< _CharT, _InIter >::\fBchar_type\fP

Public typedefs.

Definition at line 1376 of file locale_facets_nonio.h.

template<typename _CharT , typename _InIter > typedef _InIter \fBstd::money_get\fP< _CharT, _InIter >::\fBiter_type\fP

Public typedefs.

Definition at line 1377 of file locale_facets_nonio.h.

template<typename _CharT , typename _InIter > typedef \fBbasic_string\fP<_CharT> \fBstd::money_get\fP< _CharT, _InIter >::\fBstring_type\fP

Public typedefs.

Definition at line 1378 of file locale_facets_nonio.h.

Constructor & Destructor Documentation

template<typename _CharT , typename _InIter > \fBstd::money_get\fP< _CharT, _InIter >::\fBmoney_get\fP (size_t__refs = \fC0\fP)\fC [inline]\fP, \fC [explicit]\fP

Constructor performs initialization. This is the constructor provided by the standard.

Parameters:

__refs Passed to the base facet class.

Definition at line 1392 of file locale_facets_nonio.h.

template<typename _CharT , typename _InIter > virtual \fBstd::money_get\fP< _CharT, _InIter >::~\fBmoney_get\fP ()\fC [inline]\fP, \fC [protected]\fP, \fC [virtual]\fP

Destructor.

Definition at line 1460 of file locale_facets_nonio.h.

Member Function Documentation

template<typename _CharT , typename _InIter > virtual \fBiter_type\fP \fBstd::money_get\fP< _CharT, _InIter >::do_get (\fBiter_type\fP__s, \fBiter_type\fP__end, bool__intl, \fBios_base\fP &__io, \fBios_base::iostate\fP &__err, long double &__units) const\fC [protected]\fP, \fC [virtual]\fP

Read and parse a monetary value. This function reads and parses characters representing a monetary value. This function is a hook for derived classes to change the value returned.

See also:

get() for details.

Referenced by std::money_get< _CharT, _InIter >::get().

template<typename _CharT , typename _InIter > virtual \fBiter_type\fP \fBstd::money_get\fP< _CharT, _InIter >::do_get (\fBiter_type\fP__s, \fBiter_type\fP__end, bool__intl, \fBios_base\fP &__io, \fBios_base::iostate\fP &__err, \fBstring_type\fP &__digits) const\fC [protected]\fP, \fC [virtual]\fP

Read and parse a monetary value. This function reads and parses characters representing a monetary value. This function is a hook for derived classes to change the value returned.

See also:

get() for details.

template<typename _CharT , typename _InIter > \fBiter_type\fP \fBstd::money_get\fP< _CharT, _InIter >::get (\fBiter_type\fP__s, \fBiter_type\fP__end, bool__intl, \fBios_base\fP &__io, \fBios_base::iostate\fP &__err, long double &__units) const\fC [inline]\fP

Read and parse a monetary value. This function reads characters from __s, interprets them as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and returns the result in units as an integral value moneypunct::frac_digits() * the actual amount. For example, the string $10.01 in a US locale would store 1001 in units.

Any characters not part of a valid money amount are not consumed.

If a money value cannot be parsed from the input stream, sets err=(err|io.failbit). If the stream is consumed before finishing parsing, sets err=(err|io.failbit|io.eofbit). units is unchanged if parsing fails.

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

Parameters:

__s Start of characters to parse.

__end End of characters to parse.

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

__io Source of facets and io state.

__err Error field to set if parsing fails.

__units Place to store result of parsing.

Returns:

Iterator referencing first character beyond valid money amount.

Definition at line 1422 of file locale_facets_nonio.h.

References std::money_get< _CharT, _InIter >::do_get().

template<typename _CharT , typename _InIter > \fBiter_type\fP \fBstd::money_get\fP< _CharT, _InIter >::get (\fBiter_type\fP__s, \fBiter_type\fP__end, bool__intl, \fBios_base\fP &__io, \fBios_base::iostate\fP &__err, \fBstring_type\fP &__digits) const\fC [inline]\fP

Read and parse a monetary value. This function reads characters from __s, interprets them as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and returns the result in digits. For example, the string $10.01 in a US locale would store 1001 in digits.

Any characters not part of a valid money amount are not consumed.

If a money value cannot be parsed from the input stream, sets err=(err|io.failbit). If the stream is consumed before finishing parsing, sets err=(err|io.failbit|io.eofbit).

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

Parameters:

__s Start of characters to parse.

__end End of characters to parse.

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

__io Source of facets and io state.

__err Error field to set if parsing fails.

__digits Place to store result of parsing.

Returns:

Iterator referencing first character beyond valid money amount.

Definition at line 1453 of file locale_facets_nonio.h.

References std::money_get< _CharT, _InIter >::do_get().

Member Data Documentation

template<typename _CharT , typename _InIter > \fBlocale::id\fP \fBstd::money_get\fP< _CharT, _InIter >::id\fC [static]\fP

Numpunct facet id.

Definition at line 1382 of file locale_facets_nonio.h.

Author

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