Init
This commit is contained in:
15
cppdraft/locale/moneypunct/byname.md
Normal file
15
cppdraft/locale/moneypunct/byname.md
Normal file
@@ -0,0 +1,15 @@
|
||||
[locale.moneypunct.byname]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.moneypunct.byname)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.moneypunct.byname)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.moneypunct.byname)
|
||||
|
||||
#### 28.3.4.7.5 Class template moneypunct_byname [locale.moneypunct.byname]
|
||||
|
||||
[ð](#lib:moneypunct_byname)
|
||||
|
||||
namespace std {template<class charT, bool Intl = false>class moneypunct_byname : public moneypunct<charT, Intl> {public:using pattern = money_base::pattern; using string_type = basic_string<charT>; explicit moneypunct_byname(const char*, size_t refs = 0); explicit moneypunct_byname(const string&, size_t refs = 0); protected:~moneypunct_byname(); };}
|
||||
126
cppdraft/locale/moneypunct/general.md
Normal file
126
cppdraft/locale/moneypunct/general.md
Normal file
@@ -0,0 +1,126 @@
|
||||
[locale.moneypunct.general]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.moneypunct.general)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.moneypunct.general)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.moneypunct.general)
|
||||
|
||||
#### 28.3.4.7.4 Class template moneypunct [[locale.moneypunct]](locale.moneypunct#general)
|
||||
|
||||
#### 28.3.4.7.4.1 General [locale.moneypunct.general]
|
||||
|
||||
[ð](#lib:moneypunct)
|
||||
|
||||
namespace std {class money_base {public:enum part { none, space, symbol, sign, value }; struct pattern { char field[4]; }; }; template<class charT, bool International = false>class moneypunct : public locale::facet, public money_base {public:using char_type = charT; using string_type = basic_string<charT>; explicit moneypunct(size_t refs = 0);
|
||||
|
||||
charT decimal_point() const;
|
||||
charT thousands_sep() const;
|
||||
string grouping() const;
|
||||
string_type curr_symbol() const;
|
||||
string_type positive_sign() const;
|
||||
string_type negative_sign() const; int frac_digits() const;
|
||||
pattern pos_format() const;
|
||||
pattern neg_format() const; static locale::id id; static const bool intl = International; protected:~moneypunct(); 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; };}
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4465)
|
||||
|
||||
The moneypunct<> facet defines monetary formatting parameters
|
||||
used by money_get<> and money_put<>[.](#1.sentence-1)
|
||||
|
||||
A monetary format is a sequence of four components,
|
||||
specified by a pattern value p,
|
||||
such that the part value static_cast<part>(p.field[i]) determines the ith component of the format[.](#1.sentence-2)[230](#footnote-230 "An array of char, rather than an array of part, is specified for pattern::field purely for efficiency.")
|
||||
|
||||
In the field member of a pattern object,
|
||||
each value symbol, sign, value, and
|
||||
either space or none appears exactly once[.](#1.sentence-3)
|
||||
|
||||
The value none, if present, is not first;
|
||||
the value space, if present, is neither first nor last[.](#1.sentence-4)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4484)
|
||||
|
||||
Where none or space appears,
|
||||
whitespace is permitted in the format,
|
||||
except where none appears at the end,
|
||||
in which case no whitespace is permitted[.](#2.sentence-1)
|
||||
|
||||
The value space indicates that
|
||||
at least one space is required at that position[.](#2.sentence-2)
|
||||
|
||||
Where symbol appears,
|
||||
the sequence of characters returned by curr_symbol() is permitted, and
|
||||
can be required[.](#2.sentence-3)
|
||||
|
||||
Where sign appears,
|
||||
the first (if any) of the sequence of characters returned bypositive_sign() or negative_sign() (respectively as the monetary value is non-negative or negative) is required[.](#2.sentence-4)
|
||||
|
||||
Any remaining characters of the sign sequence are required after
|
||||
all other format components[.](#2.sentence-5)
|
||||
|
||||
Where value appears, the absolute numeric monetary value is required[.](#2.sentence-6)
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4502)
|
||||
|
||||
The format of the numeric monetary value is a decimal number:
|
||||
|
||||
value :
|
||||
units fractionalopt
|
||||
decimal-point digits
|
||||
|
||||
fractional :
|
||||
decimal-point digitsopt
|
||||
|
||||
if frac_digits() returns a positive value, or
|
||||
|
||||
value :
|
||||
units
|
||||
|
||||
otherwise[.](#3.sentence-1)
|
||||
|
||||
The symbol *decimal-point* indicates the character returned by decimal_point()[.](#3.sentence-2)
|
||||
|
||||
The other symbols are defined as follows:
|
||||
|
||||
units :
|
||||
digits
|
||||
digits thousands-sep units
|
||||
|
||||
digits :
|
||||
adigit digitsopt
|
||||
|
||||
In the syntax specification,
|
||||
the symbol *adigit* is any of the values ct.widen(c) for c in the range '0' through '9' (inclusive) andct is a reference of type const ctype<charT>& obtained as described in the definitions
|
||||
of money_get<> and money_put<>[.](#3.sentence-4)
|
||||
|
||||
The symbol *thousands-sep* is the character returned by thousands_sep()[.](#3.sentence-5)
|
||||
|
||||
The space character used is the value ct.widen(' ')[.](#3.sentence-6)
|
||||
|
||||
Whitespace characters are those characters c for which ci.is(space, c) returns true[.](#3.sentence-7)
|
||||
|
||||
The number of digits required after the decimal point (if any)
|
||||
is exactly the value returned by frac_digits()[.](#3.sentence-8)
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4548)
|
||||
|
||||
The placement of thousands-separator characters (if any)
|
||||
is determined by the value returned by grouping(),
|
||||
defined identically as the member numpunct<>::do_grouping()[.](#4.sentence-1)
|
||||
|
||||
[230)](#footnote-230)[230)](#footnoteref-230)
|
||||
|
||||
An array of char,
|
||||
rather than an array of part,
|
||||
is specified for pattern::field purely for efficiency[.](#footnote-230.sentence-1)
|
||||
31
cppdraft/locale/moneypunct/members.md
Normal file
31
cppdraft/locale/moneypunct/members.md
Normal file
@@ -0,0 +1,31 @@
|
||||
[locale.moneypunct.members]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.moneypunct.members)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.moneypunct.members)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.moneypunct.members)
|
||||
|
||||
#### 28.3.4.7.4 Class template moneypunct [[locale.moneypunct]](locale.moneypunct#members)
|
||||
|
||||
#### 28.3.4.7.4.2 Members [locale.moneypunct.members]
|
||||
|
||||
[ð](#lib:moneypunct,decimal_point)
|
||||
|
||||
charT decimal_point() const;
|
||||
charT thousands_sep() const;
|
||||
string grouping() const;
|
||||
string_type curr_symbol() const;
|
||||
string_type positive_sign() const;
|
||||
string_type negative_sign() const;int frac_digits() const;
|
||||
pattern pos_format() const;
|
||||
pattern neg_format() const;
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4576)
|
||||
|
||||
Each of these functions *F* returns the result of calling the corresponding
|
||||
virtual member functiondo_*F*()[.](#1.sentence-1)
|
||||
147
cppdraft/locale/moneypunct/virtuals.md
Normal file
147
cppdraft/locale/moneypunct/virtuals.md
Normal file
@@ -0,0 +1,147 @@
|
||||
[locale.moneypunct.virtuals]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.moneypunct.virtuals)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.moneypunct.virtuals)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.moneypunct.virtuals)
|
||||
|
||||
#### 28.3.4.7.4 Class template moneypunct [[locale.moneypunct]](locale.moneypunct#virtuals)
|
||||
|
||||
#### 28.3.4.7.4.3 Virtual functions [locale.moneypunct.virtuals]
|
||||
|
||||
[ð](#lib:moneypunct,do_decimal_point)
|
||||
|
||||
`charT do_decimal_point() const;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4590)
|
||||
|
||||
*Returns*: The radix separator to use
|
||||
in case do_frac_digits() is greater than zero[.](#1.sentence-1)[231](#footnote-231 "In common U.S. locales this is '.'.")
|
||||
|
||||
[ð](#lib:moneypunct,do_thousands_sep)
|
||||
|
||||
`charT do_thousands_sep() const;
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4605)
|
||||
|
||||
*Returns*: The digit group separator to use
|
||||
in case do_grouping() specifies a digit grouping pattern[.](#2.sentence-1)[232](#footnote-232 "In common U.S. locales this is ','.")
|
||||
|
||||
[ð](#lib:moneypunct,do_grouping)
|
||||
|
||||
`string do_grouping() const;
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4620)
|
||||
|
||||
*Returns*: A pattern defined identically as, but not necessarily equal to,
|
||||
the result of numpunct<charT>::do_grouping()[.](#3.sentence-1)[233](#footnote-233 "To specify grouping by 3s, the value is "\003" not "3".")
|
||||
|
||||
[ð](#lib:moneypunct,do_curr_symbol)
|
||||
|
||||
`string_type do_curr_symbol() const;
|
||||
`
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4636)
|
||||
|
||||
*Returns*: A string to use as the currency identifier symbol[.](#4.sentence-1)
|
||||
|
||||
[*Note [1](#note-1)*:
|
||||
|
||||
For specializations where the second template parameter is true,
|
||||
this is typically four characters long:
|
||||
a three-letter code as specified by ISO 4217[[bib]](bibliography#bib:iso4217 "Bibliography") followed by a space[.](#4.sentence-2)
|
||||
|
||||
â *end note*]
|
||||
|
||||
[ð](#lib:moneypunct,do_positive_sign)
|
||||
|
||||
`string_type do_positive_sign() const;
|
||||
string_type do_negative_sign() const;
|
||||
`
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4655)
|
||||
|
||||
*Returns*: do_positive_sign() returns the string to use to indicate a positive monetary value;[234](#footnote-234 "This is usually the empty string.")do_negative_sign() returns the string to use to indicate a negative value[.](#5.sentence-1)
|
||||
|
||||
[ð](#lib:moneypunct,do_frac_digits)
|
||||
|
||||
`int do_frac_digits() const;
|
||||
`
|
||||
|
||||
[6](#6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4672)
|
||||
|
||||
*Returns*: The number of digits after the decimal radix separator, if any[.](#6.sentence-1)[235](#footnote-235 "In common U.S. locales, this is 2.")
|
||||
|
||||
[ð](#lib:moneypunct,do_pos_format)
|
||||
|
||||
`pattern do_pos_format() const;
|
||||
pattern do_neg_format() const;
|
||||
`
|
||||
|
||||
[7](#7)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4688)
|
||||
|
||||
*Returns*: The specializations required in Table [92](locale.category#tab:locale.spec "Table 92: Required specializations") ([[locale.category]](locale.category "28.3.3.1.2.1 Type locale::category")), namely
|
||||
|
||||
- [(7.1)](#7.1)
|
||||
|
||||
moneypunct<char>,
|
||||
|
||||
- [(7.2)](#7.2)
|
||||
|
||||
moneypunct<wchar_t>,
|
||||
|
||||
- [(7.3)](#7.3)
|
||||
|
||||
moneypunct<char, true>, and
|
||||
|
||||
- [(7.4)](#7.4)
|
||||
|
||||
moneypunct<wchar_t, true>,
|
||||
|
||||
return an object of type pattern initialized to { symbol, sign, none, value }[.](#7.sentence-1)[236](#footnote-236 "Note that the international symbol returned by do_curr_symbol() usually contains a space, itself; for example, "USD ".")
|
||||
|
||||
[231)](#footnote-231)[231)](#footnoteref-231)
|
||||
|
||||
In common U.S. locales this is '.'[.](#footnote-231.sentence-1)
|
||||
|
||||
[232)](#footnote-232)[232)](#footnoteref-232)
|
||||
|
||||
In common U.S. locales this is ','[.](#footnote-232.sentence-1)
|
||||
|
||||
[233)](#footnote-233)[233)](#footnoteref-233)
|
||||
|
||||
To specify grouping by 3s,
|
||||
the value is "\003" *not* "3"[.](#footnote-233.sentence-1)
|
||||
|
||||
[234)](#footnote-234)[234)](#footnoteref-234)
|
||||
|
||||
This is usually the empty string[.](#footnote-234.sentence-1)
|
||||
|
||||
[235)](#footnote-235)[235)](#footnoteref-235)
|
||||
|
||||
In common U.S. locales, this is 2[.](#footnote-235.sentence-1)
|
||||
|
||||
[236)](#footnote-236)[236)](#footnoteref-236)
|
||||
|
||||
Note that the international symbol returned by do_curr_symbol() usually contains a space, itself;
|
||||
for example, "USD "[.](#footnote-236.sentence-1)
|
||||
Reference in New Issue
Block a user