Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

moneypunct, moneypunct_byname


inherits frommoneypunct_base moneypunct_bynameinherits frommoneypunct inherits fromlocale::facet

Summary

Monetary punctuation facets.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <locale>
class money_base;
template <class charT, bool International = false>
class moneypunct;

Description

The moneypunct facets include formatting specifications and punctuation character for monetary values. The moneypunct facet is used with the "C" locale, while the moneypunct_byname facet is used with named locales.

The facet is used by money_put for outputting formatted representations of monetary values and by money_get for reading these strings back in.

money_base includes a structure, pattern, that specifies the order of syntactic elements in a monetary value and enumeration values representing those elements. The pattern struct includes a simple array of characters, field. Each index in field is taken up by an enumeration value indicating the location of a syntactic element. The enumeration values are described below:

Format Flag Meaning
none
No grouping separator
space
Use space for grouping separator
symbol
Currency symbol
sign
Sign of monetary value
value
The monetary value itself

The do_pos_format and do_neg_format member functions of moneypunct both return the pattern type. See the description of these functions for further elaboration.

Interface

Types

char_type
string_type

Constructors

explicit moneypunct(size_t refs = 0) 
explicit moneypunct_byname(const char* name, 
                             size_t refs = 0); 

Destructors

~moneypunct();  // virtual and protected

Static Members

static locale::id id;
static const bool intl = Intl; 

Public Member Functions

The public members of the moneypunct and moneypunct_byname facets include an interface to protected members. Each public member xxx has a corresponding virtual protected member do_xxx. All work is delegated to these protected members. For instance, the long version of the public decimal_point function simply calls its protected cousin do_decimal_point.

string_type  curr_symbol()   const; 
charT        decimal_point() const; 
int          frac_digits()   const; 
string       grouping()      const; 
pattern      neg_format()    const; 
string_type  negative_sign() const; 
pattern      pos_format()    const; 
string_type  positive_sign() const; 
charT        thousands_sep() const; 

Protected Member Functions

virtual string_type 
do_curr_symbol()   const; 
virtual charT        
do_decimal_point() const; 
virtual int          
do_frac_digits()   const; 
virtual string       
do_grouping()      const; 
virtual string_type 
do_negative_sign() const; 
virtual pattern 
do_neg_format()    const; 
virtual pattern 
do_pos_format()    const; 
virtual string_type 
do_positive_sign() const; 
virtual charT        
do_thousands_sep() const; 

Example

See Also

locale, facets, money_put, money_get



Previous fileTop of documentContentsIndexNext file
©Copyright 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998