virtual iter_type do_get(iter_type first, iter_type last, bool intl,
ios_base& x, ios_base::iostate& st, string_type& val) const;
virtual iter_type do_get(iter_type first, iter_type last, bool intl,
ios_base& x, ios_base::iostate& st, long double& val) const;
The first virtual protected member function endeavors to match sequential elements beginning at first
in the sequence
[first, last)
until it has recognized a complete, nonempty monetary input field. If successful, it converts this field
to a sequence of one or more decimal digits, optionally preceded by a minus sign (-
), to represent the amount and
stores the result in the string_type
object val
. It returns an iterator designating the first element beyond the
monetary input field. Otherwise, the function stores an empty sequence in val
and sets ios_base::failbit
in st
. It
returns an iterator designating the first element beyond any prefix of a valid monetary input field. In either case, if the
return value equals last
, the function sets ios_base::eofbit
in st
.
The second virtual protected member function behaves the same as the first, except that, if successful, it converts the
optionally-signed digit sequence to a value of type long double and stores that value in val
.
The format of a monetary input field is determined by the locale facet fac
returned by the (effective) call use_facet
<
moneypunct
<E, intl>(x.
getloc
())
. Specifically:
fac.
neg_format
()
determines the order in which components of the field occurfac.
curr_symbol
()
determines the sequence of elements that constitutes a currency symbolfac.
positive_sign
()
determines the sequence of elements that constitutes a positive signfac.
negative_sign
()
determines the sequence of elements that constitutes a negative signfac.
grouping
()
determines how digits are grouped to the left of any decimal pointfac.
thousands_sep
()
determines the element that separates groups of digits to the left of any decimal pointfac.
decimal_point
()
determines the element that separates the integer digits from the fraction digitsfac.
frac_digits
()
determines the number of significant fraction digits to the right of any decimal pointIf the sign string (fac.negative_sign
or fac.positive_sign
) has more than one element, only the first element is
matched where the element equal to money_base::
sign
appears in the format pattern (fac.neg_format
). Any
remaining elements are matched at the end of the monetary input field. If neither string has a first element that matches
the next element in the monetary input field, the sign string is taken as empty and the sign is positive.
If x.
flags
() &
showbase
is nonzero, the string fac.curr_symbol
must match where the element equal to
money_base::
symbol
appears in the format pattern. Otherwise, if money_base::symbol
occurs at the end of the
format pattern, and if no elements of the sign string remain to be matched, the currency symbol is not matched.
Otherwise, the currency symbol is optionally matched.
If no instances of fac.thousands_sep()
occur in the value portion of the monetary input field (where the element
equal to money_base::
value
appears in the format pattern), no grouping constraint is imposed. Otherwise, any
grouping constraints imposed by fac.grouping()
are enforced. Note that the resulting digit sequence represents an
integer whose low-order fac.frac_digits()
decimal digits are considered to the right of the decimal point.
Arbitrary white space is matched where the element equal to money_base::
space
appears in the format pattern, if it
appears other than at the end of the format pattern. Otherwise, no internal white space is matched. An element c
is
considered white space if use_facet
<
ctype
<E>(x.
getloc
()).
is
(ctype_base::
space
, c)
is true.