Template Class Moneypunct_byname

A template class for implementation of the moneypunct template class.

Listing: Template Class Moneypunct_byname Synopsis
namespace std {
template <class charT, bool Intl = false>

class moneypunct_byname : public moneypunct<charT, Intl> {

public:

typedef money_base::pattern pattern; 

typedef basic_string<charT> string_type; 

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

protected:

~moneypunct_byname(); // virtual 

virtual charT do_decimal_point() const;

virtual charT do_thousands_sep() const;

virtual string do_grouping() const;

virtual string_type do_curr_symbol() const;

virtual string_type do_positive_sign() const;

virtual string_type do_negative_sign() const;

virtual int do_frac_digits() const;

virtual pattern do_pos_format() const;

virtual pattern do_neg_format() const;

};

}

When a named locale is created:

  std::locale my_loc("MyLocale");
  

this places the facet moneypunct_byname("MyLocale") in the locale. The moneypunct_byname constructor considers the name it is constructed with as the name of a data file which may or may not contain moneypunct data. There are 4 keywords that mark the beginning of moneypunct data in a locale data file.

These data sections can appear in any order in the locale data file. And they are all optional. Any data not specified defaults to that of the "C" locale. Wide characters and strings can be represented in the narrow locale data file using hexadecimal or universal format (for example, '\u06BD'). See the rules for Strings and Characters in Locale Data Files for more syntax details.