money_get Class Template Reference

#include <locale_facets.h>

Inheritance diagram for money_get:

Inheritance graph
Collaboration diagram for money_get:

Collaboration graph
List of all members.

Detailed Description

template<typename CharT, typename InIter>
class std::money_get< CharT, InIter >

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 3968 of file locale_facets.h.

Public Types

Public Member Functions

Static Public Attributes

Protected Member Functions

Static Protected Member Functions


Member Typedef Documentation

typedef CharT char_type
 

Public typedefs.

Definition at line 3974 of file locale_facets.h.

typedef InIter iter_type
 

Public typedefs.

Definition at line 3975 of file locale_facets.h.

Referenced by money_get::do_get().

typedef basic_string<CharT> string_type
 

Public typedefs.

Definition at line 3976 of file locale_facets.h.

Referenced by money_get::do_get(), and money_get::get().


Constructor & Destructor Documentation

money_get 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 3990 of file locale_facets.h.

virtual ~money_get  )  [inline, protected, virtual]
 

Destructor.

Definition at line 4057 of file locale_facets.h.


Member Function Documentation

InIter 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 1487 of file locale_facets.tcc.

References basic_string::assign(), basic_string::data(), ios_base::iostate, money_get::iter_type, basic_string::size(), money_get::string_type, and ctype_abstract_base::widen().

InIter 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 1472 of file locale_facets.tcc.

References basic_string::c_str(), ios_base::iostate, and money_get::iter_type.

Referenced by money_get::get().

iter_type 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:
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 4050 of file locale_facets.h.

References money_get::do_get(), ios_base::iostate, and money_get::string_type.

iter_type 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:
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 4020 of file locale_facets.h.

References money_get::do_get(), and ios_base::iostate.


Member Data Documentation

locale::id id [static]
 

Numpunct facet id.

Definition at line 4088 of file locale_facets.h.


The documentation for this class was generated from the following files:
Generated on Sun Sep 12 15:50:23 2004 for libstdc++ source by doxygen 1.3.8