Init
This commit is contained in:
171
cppdraft/locale/money/get.md
Normal file
171
cppdraft/locale/money/get.md
Normal file
@@ -0,0 +1,171 @@
|
||||
[locale.money.get]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.money.get)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.money.get)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.money.get)
|
||||
|
||||
#### 28.3.4.7.2 Class template money_get [locale.money.get]
|
||||
|
||||
#### [28.3.4.7.2.1](#general) General [[locale.money.get.general]](locale.money.get.general)
|
||||
|
||||
[ð](#lib:money_get)
|
||||
|
||||
namespace std {template<class charT, class InputIterator = istreambuf_iterator<charT>>class money_get : public locale::facet {public:using char_type = charT; using iter_type = InputIterator; using string_type = basic_string<charT>; explicit money_get(size_t refs = 0);
|
||||
|
||||
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; static locale::id id; protected:~money_get(); virtual iter_type do_get(iter_type, iter_type, bool, ios_base&,
|
||||
ios_base::iostate& err, long double& units) const; virtual iter_type do_get(iter_type, iter_type, bool, ios_base&,
|
||||
ios_base::iostate& err, string_type& digits) const; };}
|
||||
|
||||
#### [28.3.4.7.2.2](#members) Members [[locale.money.get.members]](locale.money.get.members)
|
||||
|
||||
[ð](#lib:money_get,get)
|
||||
|
||||
`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;
|
||||
`
|
||||
|
||||
[1](#members-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4175)
|
||||
|
||||
*Returns*: do_get(s, end, intl, f, err, quant)[.](#members-1.sentence-1)
|
||||
|
||||
#### [28.3.4.7.2.3](#virtuals) Virtual functions [[locale.money.get.virtuals]](locale.money.get.virtuals)
|
||||
|
||||
[ð](#lib:money_get,do_get)
|
||||
|
||||
`iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
|
||||
ios_base::iostate& err, long double& units) const;
|
||||
iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
|
||||
ios_base::iostate& err, string_type& digits) const;
|
||||
`
|
||||
|
||||
[1](#virtuals-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4191)
|
||||
|
||||
*Effects*: Reads characters from s to parse and construct a monetary value
|
||||
according to the format specified by
|
||||
a moneypunct<charT, Intl> facet reference mp and the character mapping specified by
|
||||
a ctype<charT> facet reference ct obtained from the locale returned by str.getloc(), andstr.flags()[.](#virtuals-1.sentence-1)
|
||||
|
||||
If a valid sequence is recognized, does not change err;
|
||||
otherwise, sets err to (err | str.failbit), or(err | str.failbit | str.eofbit) if no more characters are available,
|
||||
and does not change units or digits[.](#virtuals-1.sentence-2)
|
||||
|
||||
Uses the pattern returned by mp.neg_format() to parse all values[.](#virtuals-1.sentence-3)
|
||||
|
||||
The result is returned as an integral value stored in units or as a sequence of digits possibly preceded by a minus sign
|
||||
(as produced by ct.widen(c) where c is '-' or
|
||||
in the range from '0' through '9' (inclusive))
|
||||
stored in digits[.](#virtuals-1.sentence-4)
|
||||
|
||||
[*Example [1](#virtuals-example-1)*:
|
||||
|
||||
The sequence $1,056.23 in a common United States locale would yield,
|
||||
for units, 105623, or,
|
||||
for digits, "105623"[.](#virtuals-1.sentence-5)
|
||||
|
||||
â *end example*]
|
||||
|
||||
If mp.grouping() indicates that no thousands separators are permitted,
|
||||
any such characters are not read, and
|
||||
parsing is terminated at the point where they first appear[.](#virtuals-1.sentence-6)
|
||||
|
||||
Otherwise, thousands separators are optional;
|
||||
if present, they are checked for correct placement only after
|
||||
all format components have been read[.](#virtuals-1.sentence-7)
|
||||
|
||||
[2](#virtuals-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4223)
|
||||
|
||||
Where money_base::space or money_base::none appears as the last element in the format pattern,
|
||||
no whitespace is consumed[.](#virtuals-2.sentence-1)
|
||||
|
||||
Otherwise, where money_base::space appears in any of
|
||||
the initial elements of the format pattern,
|
||||
at least one whitespace character is required[.](#virtuals-2.sentence-2)
|
||||
|
||||
Where money_base::none appears
|
||||
in any of the initial elements of the format pattern,
|
||||
whitespace is allowed but not required[.](#virtuals-2.sentence-3)
|
||||
|
||||
If (str.flags() & str.showbase) is false,
|
||||
the currency symbol is optional and
|
||||
is consumed only if other characters are needed to complete the format;
|
||||
otherwise, the currency symbol is required[.](#virtuals-2.sentence-4)
|
||||
|
||||
[3](#virtuals-3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4238)
|
||||
|
||||
If the first character (if any) in
|
||||
the string pos returned by mp.positive_sign() or
|
||||
the string neg returned by mp.negative_sign() is recognized in the position indicated by sign in the format pattern,
|
||||
it is consumed and
|
||||
any remaining characters in the string are required
|
||||
after all the other format components[.](#virtuals-3.sentence-1)
|
||||
|
||||
[*Example [2](#virtuals-example-2)*:
|
||||
|
||||
If showbase is off,
|
||||
then for a neg value of "()" and
|
||||
a currency symbol of "L",
|
||||
in "(100 L)" the "L" is consumed;
|
||||
but if neg is "-",
|
||||
the "L" in "-100 L" is not consumed[.](#virtuals-3.sentence-2)
|
||||
|
||||
â *end example*]
|
||||
|
||||
If pos or neg is empty,
|
||||
the sign component is optional, and
|
||||
if no sign is detected,
|
||||
the result is given the sign that corresponds to the source of the empty string[.](#virtuals-3.sentence-3)
|
||||
|
||||
Otherwise,
|
||||
the character in the indicated position must match
|
||||
the first character of pos or neg,
|
||||
and the result is given the corresponding sign[.](#virtuals-3.sentence-4)
|
||||
|
||||
If the first character of pos is equal to
|
||||
the first character of neg,
|
||||
or if both strings are empty,
|
||||
the result is given a positive sign[.](#virtuals-3.sentence-5)
|
||||
|
||||
[4](#virtuals-4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4267)
|
||||
|
||||
Digits in the numeric monetary component are extracted and
|
||||
placed in digits, or into a character buffer buf1 for conversion to produce a value for units,
|
||||
in the order in which they appear,
|
||||
preceded by a minus sign if and only if the result is negative[.](#virtuals-4.sentence-1)
|
||||
|
||||
The value units is produced as if by[229](#footnote-229 "The semantics here are different from ct.narrow.")for (int i = 0; i < n; ++i) buf2[i] = src[find(atoms, atoms + sizeof(src), buf1[i]) - atoms];
|
||||
buf2[n] = 0;
|
||||
sscanf(buf2, "%Lf", &units); where n is the number of characters placed in buf1,buf2 is a character buffer, and
|
||||
the values src and atoms are defined as if bystatic const char src[] = "0123456789-";
|
||||
charT atoms[sizeof(src)];
|
||||
ct.widen(src, src + sizeof(src) - 1, atoms);
|
||||
|
||||
[5](#virtuals-5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4292)
|
||||
|
||||
*Returns*: An iterator pointing immediately beyond
|
||||
the last character recognized as part of a valid monetary quantity[.](#virtuals-5.sentence-1)
|
||||
|
||||
[229)](#footnote-229)[229)](#footnoteref-229)
|
||||
|
||||
The semantics here are different from ct.narrow[.](#footnote-229.sentence-1)
|
||||
25
cppdraft/locale/money/get/general.md
Normal file
25
cppdraft/locale/money/get/general.md
Normal file
@@ -0,0 +1,25 @@
|
||||
[locale.money.get.general]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.money.get.general)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.money.get.general)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.money.get.general)
|
||||
|
||||
#### 28.3.4.7.2 Class template money_get [[locale.money.get]](locale.money.get#general)
|
||||
|
||||
#### 28.3.4.7.2.1 General [locale.money.get.general]
|
||||
|
||||
[ð](#lib:money_get)
|
||||
|
||||
namespace std {template<class charT, class InputIterator = istreambuf_iterator<charT>>class money_get : public locale::facet {public:using char_type = charT; using iter_type = InputIterator; using string_type = basic_string<charT>; explicit money_get(size_t refs = 0);
|
||||
|
||||
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; static locale::id id; protected:~money_get(); virtual iter_type do_get(iter_type, iter_type, bool, ios_base&,
|
||||
ios_base::iostate& err, long double& units) const; virtual iter_type do_get(iter_type, iter_type, bool, ios_base&,
|
||||
ios_base::iostate& err, string_type& digits) const; };}
|
||||
27
cppdraft/locale/money/get/members.md
Normal file
27
cppdraft/locale/money/get/members.md
Normal file
@@ -0,0 +1,27 @@
|
||||
[locale.money.get.members]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.money.get.members)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.money.get.members)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.money.get.members)
|
||||
|
||||
#### 28.3.4.7.2 Class template money_get [[locale.money.get]](locale.money.get#members)
|
||||
|
||||
#### 28.3.4.7.2.2 Members [locale.money.get.members]
|
||||
|
||||
[ð](#lib:money_get,get)
|
||||
|
||||
`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;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4175)
|
||||
|
||||
*Returns*: do_get(s, end, intl, f, err, quant)[.](#1.sentence-1)
|
||||
141
cppdraft/locale/money/get/virtuals.md
Normal file
141
cppdraft/locale/money/get/virtuals.md
Normal file
@@ -0,0 +1,141 @@
|
||||
[locale.money.get.virtuals]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.money.get.virtuals)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.money.get.virtuals)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.money.get.virtuals)
|
||||
|
||||
#### 28.3.4.7.2 Class template money_get [[locale.money.get]](locale.money.get#virtuals)
|
||||
|
||||
#### 28.3.4.7.2.3 Virtual functions [locale.money.get.virtuals]
|
||||
|
||||
[ð](#lib:money_get,do_get)
|
||||
|
||||
`iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
|
||||
ios_base::iostate& err, long double& units) const;
|
||||
iter_type do_get(iter_type s, iter_type end, bool intl, ios_base& str,
|
||||
ios_base::iostate& err, string_type& digits) const;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4191)
|
||||
|
||||
*Effects*: Reads characters from s to parse and construct a monetary value
|
||||
according to the format specified by
|
||||
a moneypunct<charT, Intl> facet reference mp and the character mapping specified by
|
||||
a ctype<charT> facet reference ct obtained from the locale returned by str.getloc(), andstr.flags()[.](#1.sentence-1)
|
||||
|
||||
If a valid sequence is recognized, does not change err;
|
||||
otherwise, sets err to (err | str.failbit), or(err | str.failbit | str.eofbit) if no more characters are available,
|
||||
and does not change units or digits[.](#1.sentence-2)
|
||||
|
||||
Uses the pattern returned by mp.neg_format() to parse all values[.](#1.sentence-3)
|
||||
|
||||
The result is returned as an integral value stored in units or as a sequence of digits possibly preceded by a minus sign
|
||||
(as produced by ct.widen(c) where c is '-' or
|
||||
in the range from '0' through '9' (inclusive))
|
||||
stored in digits[.](#1.sentence-4)
|
||||
|
||||
[*Example [1](#example-1)*:
|
||||
|
||||
The sequence $1,056.23 in a common United States locale would yield,
|
||||
for units, 105623, or,
|
||||
for digits, "105623"[.](#1.sentence-5)
|
||||
|
||||
â *end example*]
|
||||
|
||||
If mp.grouping() indicates that no thousands separators are permitted,
|
||||
any such characters are not read, and
|
||||
parsing is terminated at the point where they first appear[.](#1.sentence-6)
|
||||
|
||||
Otherwise, thousands separators are optional;
|
||||
if present, they are checked for correct placement only after
|
||||
all format components have been read[.](#1.sentence-7)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4223)
|
||||
|
||||
Where money_base::space or money_base::none appears as the last element in the format pattern,
|
||||
no whitespace is consumed[.](#2.sentence-1)
|
||||
|
||||
Otherwise, where money_base::space appears in any of
|
||||
the initial elements of the format pattern,
|
||||
at least one whitespace character is required[.](#2.sentence-2)
|
||||
|
||||
Where money_base::none appears
|
||||
in any of the initial elements of the format pattern,
|
||||
whitespace is allowed but not required[.](#2.sentence-3)
|
||||
|
||||
If (str.flags() & str.showbase) is false,
|
||||
the currency symbol is optional and
|
||||
is consumed only if other characters are needed to complete the format;
|
||||
otherwise, the currency symbol is required[.](#2.sentence-4)
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4238)
|
||||
|
||||
If the first character (if any) in
|
||||
the string pos returned by mp.positive_sign() or
|
||||
the string neg returned by mp.negative_sign() is recognized in the position indicated by sign in the format pattern,
|
||||
it is consumed and
|
||||
any remaining characters in the string are required
|
||||
after all the other format components[.](#3.sentence-1)
|
||||
|
||||
[*Example [2](#example-2)*:
|
||||
|
||||
If showbase is off,
|
||||
then for a neg value of "()" and
|
||||
a currency symbol of "L",
|
||||
in "(100 L)" the "L" is consumed;
|
||||
but if neg is "-",
|
||||
the "L" in "-100 L" is not consumed[.](#3.sentence-2)
|
||||
|
||||
â *end example*]
|
||||
|
||||
If pos or neg is empty,
|
||||
the sign component is optional, and
|
||||
if no sign is detected,
|
||||
the result is given the sign that corresponds to the source of the empty string[.](#3.sentence-3)
|
||||
|
||||
Otherwise,
|
||||
the character in the indicated position must match
|
||||
the first character of pos or neg,
|
||||
and the result is given the corresponding sign[.](#3.sentence-4)
|
||||
|
||||
If the first character of pos is equal to
|
||||
the first character of neg,
|
||||
or if both strings are empty,
|
||||
the result is given a positive sign[.](#3.sentence-5)
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4267)
|
||||
|
||||
Digits in the numeric monetary component are extracted and
|
||||
placed in digits, or into a character buffer buf1 for conversion to produce a value for units,
|
||||
in the order in which they appear,
|
||||
preceded by a minus sign if and only if the result is negative[.](#4.sentence-1)
|
||||
|
||||
The value units is produced as if by[229](#footnote-229 "The semantics here are different from ct.narrow.")for (int i = 0; i < n; ++i) buf2[i] = src[find(atoms, atoms + sizeof(src), buf1[i]) - atoms];
|
||||
buf2[n] = 0;
|
||||
sscanf(buf2, "%Lf", &units); where n is the number of characters placed in buf1,buf2 is a character buffer, and
|
||||
the values src and atoms are defined as if bystatic const char src[] = "0123456789-";
|
||||
charT atoms[sizeof(src)];
|
||||
ct.widen(src, src + sizeof(src) - 1, atoms);
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4292)
|
||||
|
||||
*Returns*: An iterator pointing immediately beyond
|
||||
the last character recognized as part of a valid monetary quantity[.](#5.sentence-1)
|
||||
|
||||
[229)](#footnote-229)[229)](#footnoteref-229)
|
||||
|
||||
The semantics here are different from ct.narrow[.](#footnote-229.sentence-1)
|
||||
113
cppdraft/locale/money/put.md
Normal file
113
cppdraft/locale/money/put.md
Normal file
@@ -0,0 +1,113 @@
|
||||
[locale.money.put]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.money.put)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.money.put)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.money.put)
|
||||
|
||||
#### 28.3.4.7.3 Class template money_put [locale.money.put]
|
||||
|
||||
#### [28.3.4.7.3.1](#general) General [[locale.money.put.general]](locale.money.put.general)
|
||||
|
||||
[ð](#lib:money_put)
|
||||
|
||||
namespace std {template<class charT, class OutputIterator = ostreambuf_iterator<charT>>class money_put : public locale::facet {public:using char_type = charT; using iter_type = OutputIterator; using string_type = basic_string<charT>; explicit money_put(size_t refs = 0);
|
||||
|
||||
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; static locale::id id; protected:~money_put(); 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; };}
|
||||
|
||||
#### [28.3.4.7.3.2](#members) Members [[locale.money.put.members]](locale.money.put.members)
|
||||
|
||||
[ð](#lib:money_put,put)
|
||||
|
||||
`iter_type put(iter_type s, bool intl, ios_base& f, char_type fill, long double quant) const;
|
||||
iter_type put(iter_type s, bool intl, ios_base& f, char_type fill, const string_type& quant) const;
|
||||
`
|
||||
|
||||
[1](#members-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4340)
|
||||
|
||||
*Returns*: do_put(s, intl, f, fill, quant)[.](#members-1.sentence-1)
|
||||
|
||||
#### [28.3.4.7.3.3](#virtuals) Virtual functions [[locale.money.put.virtuals]](locale.money.put.virtuals)
|
||||
|
||||
[ð](#lib:money_put,do_put)
|
||||
|
||||
`iter_type do_put(iter_type s, bool intl, ios_base& str,
|
||||
char_type fill, long double units) const;
|
||||
iter_type do_put(iter_type s, bool intl, ios_base& str,
|
||||
char_type fill, const string_type& digits) const;
|
||||
`
|
||||
|
||||
[1](#virtuals-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4356)
|
||||
|
||||
*Effects*: Writes characters to s according to
|
||||
the format specified by
|
||||
a moneypunct<charT, Intl> facet reference mp and
|
||||
the character mapping specified by
|
||||
a ctype<charT> facet reference ct obtained from the locale returned by str.getloc(),
|
||||
and str.flags()[.](#virtuals-1.sentence-1)
|
||||
|
||||
The argument units is transformed into
|
||||
a sequence of wide characters as if byct.widen(buf1, buf1 + sprintf(buf1, "%.0Lf", units), buf2) for character buffers buf1 and buf2[.](#virtuals-1.sentence-2)
|
||||
|
||||
If the first character in digits or buf2 is equal to ct.widen('-'),
|
||||
then the pattern used for formatting is the result of mp.neg_format();
|
||||
otherwise the pattern is the result of mp.pos_format()[.](#virtuals-1.sentence-3)
|
||||
|
||||
Digit characters are written,
|
||||
interspersed with any thousands separators and decimal point
|
||||
specified by the format,
|
||||
in the order they appear (after the optional leading minus sign) indigits or buf2[.](#virtuals-1.sentence-4)
|
||||
|
||||
In digits,
|
||||
only the optional leading minus sign and
|
||||
the immediately subsequent digit characters
|
||||
(as classified according to ct)
|
||||
are used;
|
||||
any trailing characters
|
||||
(including digits appearing after a non-digit character)
|
||||
are ignored[.](#virtuals-1.sentence-5)
|
||||
|
||||
Calls str.width(0)[.](#virtuals-1.sentence-6)
|
||||
|
||||
[2](#virtuals-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4390)
|
||||
|
||||
*Returns*: An iterator pointing immediately after the last character produced[.](#virtuals-2.sentence-1)
|
||||
|
||||
[3](#virtuals-3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4394)
|
||||
|
||||
*Remarks*: The currency symbol is generated
|
||||
if and only if (str.flags() & str.showbase) is nonzero[.](#virtuals-3.sentence-1)
|
||||
|
||||
If the number of characters generated for the specified format
|
||||
is less than the value returned by str.width() on entry to the function,
|
||||
then copies of fill are inserted as necessary
|
||||
to pad to the specified width[.](#virtuals-3.sentence-2)
|
||||
|
||||
For the value af equal to (str.flags() & str.adjustfield),
|
||||
if (af == str.internal) is true,
|
||||
the fill characters are placed
|
||||
where none or space appears in the formatting pattern;
|
||||
otherwise if (af == str.left) is true,
|
||||
they are placed after the other characters;
|
||||
otherwise, they are placed before the other characters[.](#virtuals-3.sentence-3)
|
||||
|
||||
[*Note [1](#virtuals-note-1)*:
|
||||
|
||||
It is possible, with some combinations of format patterns and flag values,
|
||||
to produce output that cannot be parsed using num_get<>::get[.](#virtuals-3.sentence-4)
|
||||
|
||||
â *end note*]
|
||||
22
cppdraft/locale/money/put/general.md
Normal file
22
cppdraft/locale/money/put/general.md
Normal file
@@ -0,0 +1,22 @@
|
||||
[locale.money.put.general]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.money.put.general)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.money.put.general)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.money.put.general)
|
||||
|
||||
#### 28.3.4.7.3 Class template money_put [[locale.money.put]](locale.money.put#general)
|
||||
|
||||
#### 28.3.4.7.3.1 General [locale.money.put.general]
|
||||
|
||||
[ð](#lib:money_put)
|
||||
|
||||
namespace std {template<class charT, class OutputIterator = ostreambuf_iterator<charT>>class money_put : public locale::facet {public:using char_type = charT; using iter_type = OutputIterator; using string_type = basic_string<charT>; explicit money_put(size_t refs = 0);
|
||||
|
||||
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; static locale::id id; protected:~money_put(); 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; };}
|
||||
25
cppdraft/locale/money/put/members.md
Normal file
25
cppdraft/locale/money/put/members.md
Normal file
@@ -0,0 +1,25 @@
|
||||
[locale.money.put.members]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.money.put.members)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.money.put.members)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.money.put.members)
|
||||
|
||||
#### 28.3.4.7.3 Class template money_put [[locale.money.put]](locale.money.put#members)
|
||||
|
||||
#### 28.3.4.7.3.2 Members [locale.money.put.members]
|
||||
|
||||
[ð](#lib:money_put,put)
|
||||
|
||||
`iter_type put(iter_type s, bool intl, ios_base& f, char_type fill, long double quant) const;
|
||||
iter_type put(iter_type s, bool intl, ios_base& f, char_type fill, const string_type& quant) const;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4340)
|
||||
|
||||
*Returns*: do_put(s, intl, f, fill, quant)[.](#1.sentence-1)
|
||||
88
cppdraft/locale/money/put/virtuals.md
Normal file
88
cppdraft/locale/money/put/virtuals.md
Normal file
@@ -0,0 +1,88 @@
|
||||
[locale.money.put.virtuals]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#locale.money.put.virtuals)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#locale.money.put.virtuals)
|
||||
|
||||
#### 28.3.4.7 The monetary category [[category.monetary]](category.monetary#locale.money.put.virtuals)
|
||||
|
||||
#### 28.3.4.7.3 Class template money_put [[locale.money.put]](locale.money.put#virtuals)
|
||||
|
||||
#### 28.3.4.7.3.3 Virtual functions [locale.money.put.virtuals]
|
||||
|
||||
[ð](#lib:money_put,do_put)
|
||||
|
||||
`iter_type do_put(iter_type s, bool intl, ios_base& str,
|
||||
char_type fill, long double units) const;
|
||||
iter_type do_put(iter_type s, bool intl, ios_base& str,
|
||||
char_type fill, const string_type& digits) const;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4356)
|
||||
|
||||
*Effects*: Writes characters to s according to
|
||||
the format specified by
|
||||
a moneypunct<charT, Intl> facet reference mp and
|
||||
the character mapping specified by
|
||||
a ctype<charT> facet reference ct obtained from the locale returned by str.getloc(),
|
||||
and str.flags()[.](#1.sentence-1)
|
||||
|
||||
The argument units is transformed into
|
||||
a sequence of wide characters as if byct.widen(buf1, buf1 + sprintf(buf1, "%.0Lf", units), buf2) for character buffers buf1 and buf2[.](#1.sentence-2)
|
||||
|
||||
If the first character in digits or buf2 is equal to ct.widen('-'),
|
||||
then the pattern used for formatting is the result of mp.neg_format();
|
||||
otherwise the pattern is the result of mp.pos_format()[.](#1.sentence-3)
|
||||
|
||||
Digit characters are written,
|
||||
interspersed with any thousands separators and decimal point
|
||||
specified by the format,
|
||||
in the order they appear (after the optional leading minus sign) indigits or buf2[.](#1.sentence-4)
|
||||
|
||||
In digits,
|
||||
only the optional leading minus sign and
|
||||
the immediately subsequent digit characters
|
||||
(as classified according to ct)
|
||||
are used;
|
||||
any trailing characters
|
||||
(including digits appearing after a non-digit character)
|
||||
are ignored[.](#1.sentence-5)
|
||||
|
||||
Calls str.width(0)[.](#1.sentence-6)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4390)
|
||||
|
||||
*Returns*: An iterator pointing immediately after the last character produced[.](#2.sentence-1)
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L4394)
|
||||
|
||||
*Remarks*: The currency symbol is generated
|
||||
if and only if (str.flags() & str.showbase) is nonzero[.](#3.sentence-1)
|
||||
|
||||
If the number of characters generated for the specified format
|
||||
is less than the value returned by str.width() on entry to the function,
|
||||
then copies of fill are inserted as necessary
|
||||
to pad to the specified width[.](#3.sentence-2)
|
||||
|
||||
For the value af equal to (str.flags() & str.adjustfield),
|
||||
if (af == str.internal) is true,
|
||||
the fill characters are placed
|
||||
where none or space appears in the formatting pattern;
|
||||
otherwise if (af == str.left) is true,
|
||||
they are placed after the other characters;
|
||||
otherwise, they are placed before the other characters[.](#3.sentence-3)
|
||||
|
||||
[*Note [1](#note-1)*:
|
||||
|
||||
It is possible, with some combinations of format patterns and flag values,
|
||||
to produce output that cannot be parsed using num_get<>::get[.](#3.sentence-4)
|
||||
|
||||
â *end note*]
|
||||
Reference in New Issue
Block a user