Friday, January 8, 2010

money_put








Class Name money_put

Header File <locale>

Classification abstract data type



Class Relationship Diagram



Class Description

Member Classes


locale::id

Methods





virtual iter_type do_put(iter_type, bool, ios_base&, char_type fill,
long double units) const;


virtual iter_type do_put(iter_type, bool, ios_base&, char_type fill,
const string_type& digits) const;


explicit money_put(size_t refs = 0);


~money_put();


iter_type put(iter_type s, bool intl, ios_base& f, char_type fill,
long double units) const;


iter_type put(iter_type s, bool intl, ios_base& f, char_type fill,
const string_type& digits) const;




Class Description



The money_put class describes a class used to take a sequence of digits and writes
out a formatted representation of the monetary value.




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_put()

Access Protected

Classification Accessor

Syntax virtual iter_type do_put(iter_type s, bool intl,
ios_base& str,
char_type fill,
string_type& digits) const;

virtual iter_type do_put(iter_type s, bool intl,
ios_base& str,
char_type fill,
long double units) const;

Parameters s is an iterator pointing to the character buffer
used for output.

intl is set to true or false for international
formatting.

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

fill is the character used for padding.

units/digits contains the monetary value.

Returns The methods return an iterator that points to the
character past the last character produced.




Description



The do_put() method generates a monetary value contained in
the parameter units or digits. It writes out a character string that is placed character buffer
pointed to by s. The character sequence is formatted according to the format specified by
str.flags() and the moneypunct<charT, true> or moneypunct<charT, false> facet of loc. This will
depend on whether intl is true or false. Since the monetary value stored in the arguments units
or digits is the smallest possible unit of currency, any fractional portions units
and any characters in digits beyond the optional leading '-' and immediately contiguous
digits are ignored. The currency symbol is generated only if (str.flags() & ios_base::showbase)
is true. If ((str.flags() & ios_base:adjustfield) == ios_base::internal) then the
fill argument will be placed where none or space appears in the formatting pattern. The methods
return an iterator that points to the character past the last character produced.







Method put()

Access Public

Classification Accessor

Syntax iter_type put(iter_type s, bool intl, ios_base& f,
char_type fill,
string_type& quant) const;

iter_type put(iter_type s, bool intl, ios_base& f,
char_type fill,
long double quant) const;

Parameters s is an iterator pointing to the character buffer
used for output.

intl is set to true or false for international
formatting.

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

fill is the character used for padding.

quant contains the monetary value.

Returns The methods return an iterator that points to the
character past the last character produced.




Description



The put() member functions return do_put(s, intl, f, fill, quant).







Method money_put()

Access Public

Classification Constructor

Syntax explicit money_put(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_put facet object.







Method money_put()

Access Protected

Classification Destructor

Syntax ~money_put();

Parameters None

Returns None



Description



The destructor destroys a money_put facet object.






The Class Relationship Diagram for money_put






No comments: