Thursday, February 4, 2010

money_get









Class Name money_get

Header File <locale>

Classification abstract data type



Class Relationship Diagram



Class Description

Member Classes


locale::id

Methods





virtual iter_type do_get(iter_type, bool, iter_type, ios_base&,
ios_base::iostate& err, long double& units) const;


virtual iter_type do_get(iter_type, bool, iter_type, ios_base&,
ios_base::iostate& err, string_type& digits) const;


iter_type get(iter_type s, iter_type end, bool intl, ios_base& f,
ios_base::iostate& err, long double& units) const;


iter_type get(iter_type s, iter_type end, bool intl, ios_base& f,
ios_base::iostate& err, string_type& digits) const;


explicit money_get(size_t refs = 0);


~money_get();




Class Description



The money_get class describes a class used to interpret formatted monetary string
values.




locale::id



locale::id is a class used to provide an identification of a locale facet interfaces used as
an index for lookup and to encapsulate initialization.







Method do_get()

Access Protected

Classification Accessor

Syntax virtual iter_type do_get(iter_type s, iter_type end,
bool intl,
ios_base& str,
ios_base::iostate& err,
string_type& digits) const;

virtual iter_type do_get(iter_type s, iter_type end,
bool intl,
ios_base& str,
ios_base::iostate& err,
long double& units) const;

Parameters s is an input iterator that points to the beginning
character of a character sequence.

end is an input iterator that points to the end
character of a character sequence.

intl is set to true or false for international
formatting.

str is the reference of ios_base object used for
formatting information.

err is used to set error conditions in the calling
stream.

units/digits is used to store the extracted
sequence.


Returns This method returns an iterator that points to one
past the last character of a valid monetary sequence.



Description



Each version of the do_get() method reads a sequence
of characters in the range [in, end) and extracts a monetary value. Characters are
read in the range until a monetary value is assembled, an error occurs or until no
more characters are available. The characters are interpreted according to str.flags(),
moneypunct<charT, true>, or moneypunct<charT,false> facet str.getloc(). This will depend
on whether the intl argument is true or false. The extracted sequence is the smallest
possible unit of currency stored in the arguments digits as a string or calculated
as a long double and stored in the argument units. If an error occurs then digits and
units will remain unchanged. The do_get() method returns an iterator pointing
immediately beyond the last character that has been recognized as part of a valid monetary
value.





The digit group separators are optional. But if no grouping is specified then the
thousands separator will not be considered part of the monetary format. If the space
or none are apart of the format pattern in moneypunct facet then the whitespaces,
unless its at the end of the sequence, will be consumed. The currency symbol will
be optional if (str.flags() & ios_base::showbase) is false. If true then the currency
symbol is required and always consumed. If the currency symbol appears after all
other required elements then it will not be consumed.







Method get()

Access Public

Classification Modifier

Syntax iter_type get(iter_type s, iter_type end, bool intl,
ios_base& f, ios_base::iostate& err,
long double& quant) const;

iter_type get(iter_type s, iter_type end, bool intl,
ios_base& f, ios_base::iostate& err,
string_type& quant) const;

Parameters s is an input iterator that points to the beginning
character of a character sequence.

end is an input iterator that points to the end
character of a character sequence.

intl is set to true or false for international
formatting.

f is the reference of ios_base object used for
formatting information.

err is used to set error conditions in the
calling stream.

quant is used to store the extracted sequence.


Returns This method returns an iterator that points to one
past the last character of a valid monetary sequence.




Description



The get() member functions return do_get(s, end, intl, f, err, quant).







Method money_get()

Access Public

Classification Constructor

Syntax explicit money_get(size_t refs = 0);

Parameters refs, if the refs argument = 0 then the destruction
of the object is delegated to the locale or locales
which contain it. If refs = 1 then the object must
be explicitly deleted. The locale will not delete
it. The object can then be maintained across the
lifetime of multiple locales.


Returns None



Description



The constructor constructs a money_get facet object.







Method money_get()

Access Protected

Classification Destructor

Syntax ~money_get();

Parameters None

Returns None



Description



The destructor destroys a money_get facet object.






The Class Relationship Diagram for money_get






No comments: