libstdc++
std::money_get Class Reference
Inheritance diagram for std::money_get:

List of all members.

Public Types

Public Member Functions

Static Public Attributes

Protected Member Functions

Static Protected Member Functions

Friends


Detailed Description

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.


Member Typedef Documentation

typedef _CharT std::money_get::char_type

Public typedefs.

Definition at line 1376 of file locale_facets_nonio.h.

typedef _InIter std::money_get::iter_type

Public typedefs.

Definition at line 1377 of file locale_facets_nonio.h.

Public typedefs.

Definition at line 1378 of file locale_facets_nonio.h.


Constructor & Destructor Documentation

std::money_get::money_get ( size_t  __refs = 0) [inline, explicit]

Constructor performs initialization.

This is the constructor provided by the standard.

Parameters:
refsPassed to the base facet class.

Definition at line 1392 of file locale_facets_nonio.h.

virtual std::money_get::~money_get ( ) [inline, protected, virtual]

Destructor.

Definition at line 1460 of file locale_facets_nonio.h.


Member Function Documentation

_InIter std::money_get::do_get ( iter_type  __s,
iter_type  __end,
bool  __intl,
ios_base __io,
ios_base::iostate __err,
long double &  __units 
) const [protected, virtual]

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.

Definition at line 365 of file locale_facets_nonio.tcc.

References std::basic_string::c_str().

Referenced by get().

_InIter std::money_get::do_get ( iter_type  __s,
iter_type  __end,
bool  __intl,
ios_base __io,
ios_base::iostate __err,
string_type __digits 
) const [protected, virtual]

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.

Definition at line 378 of file locale_facets_nonio.tcc.

References std::ios_base::_M_getloc(), and std::basic_string::resize().

iter_type std::money_get::get ( iter_type  __s,
iter_type  __end,
bool  __intl,
ios_base __io,
ios_base::iostate __err,
long double &  __units 
) const [inline]

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:
sStart of characters to parse.
endEnd of characters to parse.
intlParameter to use_facet<moneypunct<CharT,intl> >.
ioSource of facets and io state.
errError field to set if parsing fails.
unitsPlace 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 do_get().

iter_type std::money_get::get ( iter_type  __s,
iter_type  __end,
bool  __intl,
ios_base __io,
ios_base::iostate __err,
string_type __digits 
) const [inline]

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:
sStart of characters to parse.
endEnd of characters to parse.
intlParameter to use_facet<moneypunct<CharT,intl> >.
ioSource of facets and io state.
errError field to set if parsing fails.
digitsPlace 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 do_get().


Member Data Documentation

Numpunct facet id.

Definition at line 1382 of file locale_facets_nonio.h.


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