Init
This commit is contained in:
26
cppdraft/facet/ctype/char/dtor.md
Normal file
26
cppdraft/facet/ctype/char/dtor.md
Normal file
@@ -0,0 +1,26 @@
|
||||
[facet.ctype.char.dtor]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.ctype.char.dtor)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.ctype.char.dtor)
|
||||
|
||||
#### 28.3.4.2 The ctype category [[category.ctype]](category.ctype#facet.ctype.char.dtor)
|
||||
|
||||
#### 28.3.4.2.4 ctype<char> specialization [[facet.ctype.special]](facet.ctype.special#facet.ctype.char.dtor)
|
||||
|
||||
#### 28.3.4.2.4.2 Destructor [facet.ctype.char.dtor]
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,destructor)
|
||||
|
||||
`~ctype();
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1769)
|
||||
|
||||
*Effects*: If the constructor's first argument was nonzero, and
|
||||
its second argument was true,
|
||||
does delete [] table()[.](#1.sentence-1)
|
||||
143
cppdraft/facet/ctype/char/members.md
Normal file
143
cppdraft/facet/ctype/char/members.md
Normal file
@@ -0,0 +1,143 @@
|
||||
[facet.ctype.char.members]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.ctype.char.members)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.ctype.char.members)
|
||||
|
||||
#### 28.3.4.2 The ctype category [[category.ctype]](category.ctype#facet.ctype.char.members)
|
||||
|
||||
#### 28.3.4.2.4 ctype<char> specialization [[facet.ctype.special]](facet.ctype.special#facet.ctype.char.members)
|
||||
|
||||
#### 28.3.4.2.4.3 Members [facet.ctype.char.members]
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1778)
|
||||
|
||||
In the following member descriptions,
|
||||
for unsigned char values v where v >= table_size,table()[v] is assumed to have an implementation-specific value
|
||||
(possibly different for each such value v)
|
||||
without performing the array lookup[.](#1.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,constructor)
|
||||
|
||||
`explicit ctype(const mask* tbl = nullptr, bool del = false, size_t refs = 0);
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1792)
|
||||
|
||||
*Preconditions*: Either tbl == nullptr is true or
|
||||
[tbl, tbl + table_size) is a valid range[.](#2.sentence-1)
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1797)
|
||||
|
||||
*Effects*: Passes its refs argument to its base class constructor[.](#3.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,is)
|
||||
|
||||
`bool is(mask m, char c) const;
|
||||
const char* is(const char* low, const char* high, mask* vec) const;
|
||||
`
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1809)
|
||||
|
||||
*Effects*: The second form, for all *p in the range [low, high),
|
||||
assigns into vec[p - low] the value table()[(unsigned char)*p][.](#4.sentence-1)
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1814)
|
||||
|
||||
*Returns*: The first form returns table()[(unsigned char)c] & m;
|
||||
the second form returns high[.](#5.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,scan_is)
|
||||
|
||||
`const char* scan_is(mask m, const char* low, const char* high) const;
|
||||
`
|
||||
|
||||
[6](#6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1826)
|
||||
|
||||
*Returns*: The smallest p in the range [low, high) such thattable()[(unsigned char) *p] & m is true[.](#6.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,scan_not)
|
||||
|
||||
`const char* scan_not(mask m, const char* low, const char* high) const;
|
||||
`
|
||||
|
||||
[7](#7)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1841)
|
||||
|
||||
*Returns*: The smallest p in the range [low, high) such thattable()[(unsigned char) *p] & m is false[.](#7.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,toupper)
|
||||
|
||||
`char toupper(char c) const;
|
||||
const char* toupper(char* low, const char* high) const;
|
||||
`
|
||||
|
||||
[8](#8)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1857)
|
||||
|
||||
*Returns*: do_toupper(c) or do_toupper(low, high), respectively[.](#8.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,tolower)
|
||||
|
||||
`char tolower(char c) const;
|
||||
const char* tolower(char* low, const char* high) const;
|
||||
`
|
||||
|
||||
[9](#9)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1869)
|
||||
|
||||
*Returns*: do_tolower(c) or do_tolower(low, high), respectively[.](#9.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,widen)
|
||||
|
||||
`char widen(char c) const;
|
||||
const char* widen(const char* low, const char* high, char* to) const;
|
||||
`
|
||||
|
||||
[10](#10)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1881)
|
||||
|
||||
*Returns*: do_widen(c) ordo_widen(low, high, to), respectively[.](#10.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,narrow)
|
||||
|
||||
`char narrow(char c, char dfault) const;
|
||||
const char* narrow(const char* low, const char* high, char dfault, char* to) const;
|
||||
`
|
||||
|
||||
[11](#11)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1895)
|
||||
|
||||
*Returns*: do_narrow(c, dfault) ordo_narrow(low, high, dfault, to),
|
||||
respectively[.](#11.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,table)
|
||||
|
||||
`const mask* table() const noexcept;
|
||||
`
|
||||
|
||||
[12](#12)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1910)
|
||||
|
||||
*Returns*: The first constructor argument, if it was nonzero,
|
||||
otherwise classic_table()[.](#12.sentence-1)
|
||||
24
cppdraft/facet/ctype/char/statics.md
Normal file
24
cppdraft/facet/ctype/char/statics.md
Normal file
@@ -0,0 +1,24 @@
|
||||
[facet.ctype.char.statics]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.ctype.char.statics)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.ctype.char.statics)
|
||||
|
||||
#### 28.3.4.2 The ctype category [[category.ctype]](category.ctype#facet.ctype.char.statics)
|
||||
|
||||
#### 28.3.4.2.4 ctype<char> specialization [[facet.ctype.special]](facet.ctype.special#facet.ctype.char.statics)
|
||||
|
||||
#### 28.3.4.2.4.4 Static members [facet.ctype.char.statics]
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,classic_table)
|
||||
|
||||
`static const mask* classic_table() noexcept;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1924)
|
||||
|
||||
*Returns*: A pointer to the initial element of an array of size table_size which represents the classifications of characters in the "C" locale[.](#1.sentence-1)
|
||||
26
cppdraft/facet/ctype/char/virtuals.md
Normal file
26
cppdraft/facet/ctype/char/virtuals.md
Normal file
@@ -0,0 +1,26 @@
|
||||
[facet.ctype.char.virtuals]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.ctype.char.virtuals)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.ctype.char.virtuals)
|
||||
|
||||
#### 28.3.4.2 The ctype category [[category.ctype]](category.ctype#facet.ctype.char.virtuals)
|
||||
|
||||
#### 28.3.4.2.4 ctype<char> specialization [[facet.ctype.special]](facet.ctype.special#facet.ctype.char.virtuals)
|
||||
|
||||
#### 28.3.4.2.4.5 Virtual functions [facet.ctype.char.virtuals]
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,do_toupper)
|
||||
|
||||
char do_toupper(char) const;const char* do_toupper(char* low, const char* high) const;char do_tolower(char) const;const char* do_tolower(char* low, const char* high) const;
|
||||
|
||||
virtual char do_widen(char c) const;virtual const char* do_widen(const char* low, const char* high, char* to) const;virtual char do_narrow(char c, char dfault) const;virtual const char* do_narrow(const char* low, const char* high, char dfault, char* to) const;
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1949)
|
||||
|
||||
These functions are described identically as those members of the same name
|
||||
in the ctype class template ([[locale.ctype.members]](locale.ctype.members "28.3.4.2.2.2 ctype members"))[.](#1.sentence-1)
|
||||
211
cppdraft/facet/ctype/special.md
Normal file
211
cppdraft/facet/ctype/special.md
Normal file
@@ -0,0 +1,211 @@
|
||||
[facet.ctype.special]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.ctype.special)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.ctype.special)
|
||||
|
||||
#### 28.3.4.2 The ctype category [[category.ctype]](category.ctype#facet.ctype.special)
|
||||
|
||||
#### 28.3.4.2.4 ctype<char> specialization [facet.ctype.special]
|
||||
|
||||
#### [28.3.4.2.4.1](#general) General [[facet.ctype.special.general]](facet.ctype.special.general)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e)
|
||||
|
||||
namespace std {template<>class ctype<char> : public locale::facet, public ctype_base {public:using char_type = char; explicit ctype(const mask* tab = nullptr, bool del = false, size_t refs = 0); bool is(mask m, char c) const; const char* is(const char* low, const char* high, mask* vec) const; const char* scan_is (mask m, const char* low, const char* high) const; const char* scan_not(mask m, const char* low, const char* high) const; char toupper(char c) const; const char* toupper(char* low, const char* high) const; char tolower(char c) const; const char* tolower(char* low, const char* high) const; char widen(char c) const; const char* widen(const char* low, const char* high, char* to) const; char narrow(char c, char dfault) const; const char* narrow(const char* low, const char* high, char dfault, char* to) const; static locale::id id; static const size_t table_size = *implementation-defined*; const mask* table() const noexcept; static const mask* classic_table() noexcept; protected:~ctype(); virtual char do_toupper(char c) const; virtual const char* do_toupper(char* low, const char* high) const; virtual char do_tolower(char c) const; virtual const char* do_tolower(char* low, const char* high) const; virtual char do_widen(char c) const; virtual const char* do_widen(const char* low, const char* high, char* to) const; virtual char do_narrow(char c, char dfault) const; virtual const char* do_narrow(const char* low, const char* high, char dfault, char* to) const; };}
|
||||
|
||||
[1](#general-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1748)
|
||||
|
||||
A specialization ctype<char> is provided
|
||||
so that the member functions on type char can be implemented inline[.](#general-1.sentence-1)[219](#footnote-219 "Only the char (not unsigned char and signed char) form is provided. The specialization is specified in the standard, and not left as an implementation detail, because it affects the derivation interface for ctype<char>.")
|
||||
|
||||
The implementation-defined value of
|
||||
member table_size is at least 256[.](#general-1.sentence-2)
|
||||
|
||||
[219)](#footnote-219)[219)](#footnoteref-219)
|
||||
|
||||
Only the char (not unsigned char and signed char)
|
||||
form is provided[.](#footnote-219.sentence-1)
|
||||
|
||||
The specialization is specified in the standard,
|
||||
and not left as an implementation detail,
|
||||
because it affects the derivation interface for ctype<char>[.](#footnote-219.sentence-2)
|
||||
|
||||
#### [28.3.4.2.4.2](#facet.ctype.char.dtor) Destructor [[facet.ctype.char.dtor]](facet.ctype.char.dtor)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,destructor)
|
||||
|
||||
`~ctype();
|
||||
`
|
||||
|
||||
[1](#facet.ctype.char.dtor-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1769)
|
||||
|
||||
*Effects*: If the constructor's first argument was nonzero, and
|
||||
its second argument was true,
|
||||
does delete [] table()[.](#facet.ctype.char.dtor-1.sentence-1)
|
||||
|
||||
#### [28.3.4.2.4.3](#facet.ctype.char.members) Members [[facet.ctype.char.members]](facet.ctype.char.members)
|
||||
|
||||
[1](#facet.ctype.char.members-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1778)
|
||||
|
||||
In the following member descriptions,
|
||||
for unsigned char values v where v >= table_size,table()[v] is assumed to have an implementation-specific value
|
||||
(possibly different for each such value v)
|
||||
without performing the array lookup[.](#facet.ctype.char.members-1.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,constructor)
|
||||
|
||||
`explicit ctype(const mask* tbl = nullptr, bool del = false, size_t refs = 0);
|
||||
`
|
||||
|
||||
[2](#facet.ctype.char.members-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1792)
|
||||
|
||||
*Preconditions*: Either tbl == nullptr is true or
|
||||
[tbl, tbl + table_size) is a valid range[.](#facet.ctype.char.members-2.sentence-1)
|
||||
|
||||
[3](#facet.ctype.char.members-3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1797)
|
||||
|
||||
*Effects*: Passes its refs argument to its base class constructor[.](#facet.ctype.char.members-3.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,is)
|
||||
|
||||
`bool is(mask m, char c) const;
|
||||
const char* is(const char* low, const char* high, mask* vec) const;
|
||||
`
|
||||
|
||||
[4](#facet.ctype.char.members-4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1809)
|
||||
|
||||
*Effects*: The second form, for all *p in the range [low, high),
|
||||
assigns into vec[p - low] the value table()[(unsigned char)*p][.](#facet.ctype.char.members-4.sentence-1)
|
||||
|
||||
[5](#facet.ctype.char.members-5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1814)
|
||||
|
||||
*Returns*: The first form returns table()[(unsigned char)c] & m;
|
||||
the second form returns high[.](#facet.ctype.char.members-5.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,scan_is)
|
||||
|
||||
`const char* scan_is(mask m, const char* low, const char* high) const;
|
||||
`
|
||||
|
||||
[6](#facet.ctype.char.members-6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1826)
|
||||
|
||||
*Returns*: The smallest p in the range [low, high) such thattable()[(unsigned char) *p] & m is true[.](#facet.ctype.char.members-6.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,scan_not)
|
||||
|
||||
`const char* scan_not(mask m, const char* low, const char* high) const;
|
||||
`
|
||||
|
||||
[7](#facet.ctype.char.members-7)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1841)
|
||||
|
||||
*Returns*: The smallest p in the range [low, high) such thattable()[(unsigned char) *p] & m is false[.](#facet.ctype.char.members-7.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,toupper)
|
||||
|
||||
`char toupper(char c) const;
|
||||
const char* toupper(char* low, const char* high) const;
|
||||
`
|
||||
|
||||
[8](#facet.ctype.char.members-8)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1857)
|
||||
|
||||
*Returns*: do_toupper(c) or do_toupper(low, high), respectively[.](#facet.ctype.char.members-8.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,tolower)
|
||||
|
||||
`char tolower(char c) const;
|
||||
const char* tolower(char* low, const char* high) const;
|
||||
`
|
||||
|
||||
[9](#facet.ctype.char.members-9)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1869)
|
||||
|
||||
*Returns*: do_tolower(c) or do_tolower(low, high), respectively[.](#facet.ctype.char.members-9.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,widen)
|
||||
|
||||
`char widen(char c) const;
|
||||
const char* widen(const char* low, const char* high, char* to) const;
|
||||
`
|
||||
|
||||
[10](#facet.ctype.char.members-10)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1881)
|
||||
|
||||
*Returns*: do_widen(c) ordo_widen(low, high, to), respectively[.](#facet.ctype.char.members-10.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,narrow)
|
||||
|
||||
`char narrow(char c, char dfault) const;
|
||||
const char* narrow(const char* low, const char* high, char dfault, char* to) const;
|
||||
`
|
||||
|
||||
[11](#facet.ctype.char.members-11)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1895)
|
||||
|
||||
*Returns*: do_narrow(c, dfault) ordo_narrow(low, high, dfault, to),
|
||||
respectively[.](#facet.ctype.char.members-11.sentence-1)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,table)
|
||||
|
||||
`const mask* table() const noexcept;
|
||||
`
|
||||
|
||||
[12](#facet.ctype.char.members-12)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1910)
|
||||
|
||||
*Returns*: The first constructor argument, if it was nonzero,
|
||||
otherwise classic_table()[.](#facet.ctype.char.members-12.sentence-1)
|
||||
|
||||
#### [28.3.4.2.4.4](#facet.ctype.char.statics) Static members [[facet.ctype.char.statics]](facet.ctype.char.statics)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,classic_table)
|
||||
|
||||
`static const mask* classic_table() noexcept;
|
||||
`
|
||||
|
||||
[1](#facet.ctype.char.statics-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1924)
|
||||
|
||||
*Returns*: A pointer to the initial element of an array of size table_size which represents the classifications of characters in the "C" locale[.](#facet.ctype.char.statics-1.sentence-1)
|
||||
|
||||
#### [28.3.4.2.4.5](#facet.ctype.char.virtuals) Virtual functions [[facet.ctype.char.virtuals]](facet.ctype.char.virtuals)
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e,do_toupper)
|
||||
|
||||
char do_toupper(char) const;const char* do_toupper(char* low, const char* high) const;char do_tolower(char) const;const char* do_tolower(char* low, const char* high) const;
|
||||
|
||||
virtual char do_widen(char c) const;virtual const char* do_widen(const char* low, const char* high, char* to) const;virtual char do_narrow(char c, char dfault) const;virtual const char* do_narrow(const char* low, const char* high, char dfault, char* to) const;
|
||||
|
||||
[1](#facet.ctype.char.virtuals-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1949)
|
||||
|
||||
These functions are described identically as those members of the same name
|
||||
in the ctype class template ([[locale.ctype.members]](locale.ctype.members "28.3.4.2.2.2 ctype members"))[.](#facet.ctype.char.virtuals-1.sentence-1)
|
||||
36
cppdraft/facet/ctype/special/general.md
Normal file
36
cppdraft/facet/ctype/special/general.md
Normal file
@@ -0,0 +1,36 @@
|
||||
[facet.ctype.special.general]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.ctype.special.general)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.ctype.special.general)
|
||||
|
||||
#### 28.3.4.2 The ctype category [[category.ctype]](category.ctype#facet.ctype.special.general)
|
||||
|
||||
#### 28.3.4.2.4 ctype<char> specialization [[facet.ctype.special]](facet.ctype.special#general)
|
||||
|
||||
#### 28.3.4.2.4.1 General [facet.ctype.special.general]
|
||||
|
||||
[ð](#lib:ctype%3cchar%3e)
|
||||
|
||||
namespace std {template<>class ctype<char> : public locale::facet, public ctype_base {public:using char_type = char; explicit ctype(const mask* tab = nullptr, bool del = false, size_t refs = 0); bool is(mask m, char c) const; const char* is(const char* low, const char* high, mask* vec) const; const char* scan_is (mask m, const char* low, const char* high) const; const char* scan_not(mask m, const char* low, const char* high) const; char toupper(char c) const; const char* toupper(char* low, const char* high) const; char tolower(char c) const; const char* tolower(char* low, const char* high) const; char widen(char c) const; const char* widen(const char* low, const char* high, char* to) const; char narrow(char c, char dfault) const; const char* narrow(const char* low, const char* high, char dfault, char* to) const; static locale::id id; static const size_t table_size = *implementation-defined*; const mask* table() const noexcept; static const mask* classic_table() noexcept; protected:~ctype(); virtual char do_toupper(char c) const; virtual const char* do_toupper(char* low, const char* high) const; virtual char do_tolower(char c) const; virtual const char* do_tolower(char* low, const char* high) const; virtual char do_widen(char c) const; virtual const char* do_widen(const char* low, const char* high, char* to) const; virtual char do_narrow(char c, char dfault) const; virtual const char* do_narrow(const char* low, const char* high, char dfault, char* to) const; };}
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L1748)
|
||||
|
||||
A specialization ctype<char> is provided
|
||||
so that the member functions on type char can be implemented inline[.](#1.sentence-1)[219](#footnote-219 "Only the char (not unsigned char and signed char) form is provided. The specialization is specified in the standard, and not left as an implementation detail, because it affects the derivation interface for ctype<char>.")
|
||||
|
||||
The implementation-defined value of
|
||||
member table_size is at least 256[.](#1.sentence-2)
|
||||
|
||||
[219)](#footnote-219)[219)](#footnoteref-219)
|
||||
|
||||
Only the char (not unsigned char and signed char)
|
||||
form is provided[.](#footnote-219.sentence-1)
|
||||
|
||||
The specialization is specified in the standard,
|
||||
and not left as an implementation detail,
|
||||
because it affects the derivation interface for ctype<char>[.](#footnote-219.sentence-2)
|
||||
45
cppdraft/facet/num/get/members.md
Normal file
45
cppdraft/facet/num/get/members.md
Normal file
@@ -0,0 +1,45 @@
|
||||
[facet.num.get.members]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.num.get.members)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.num.get.members)
|
||||
|
||||
#### 28.3.4.3 The numeric category [[category.numeric]](category.numeric#facet.num.get.members)
|
||||
|
||||
#### 28.3.4.3.2 Class template num_get [[locale.num.get]](locale.num.get#facet.num.get.members)
|
||||
|
||||
#### 28.3.4.3.2.2 Members [facet.num.get.members]
|
||||
|
||||
[ð](#lib:num_get,get)
|
||||
|
||||
`iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, bool& val) const;
|
||||
iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, long& val) const;
|
||||
iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, long long& val) const;
|
||||
iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, unsigned short& val) const;
|
||||
iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, unsigned int& val) const;
|
||||
iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, unsigned long& val) const;
|
||||
iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, unsigned long long& val) const;
|
||||
iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, float& val) const;
|
||||
iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, double& val) const;
|
||||
iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, long double& val) const;
|
||||
iter_type get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, void*& val) const;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2523)
|
||||
|
||||
*Returns*: do_get(in, end, str, err, val)[.](#1.sentence-1)
|
||||
288
cppdraft/facet/num/get/virtuals.md
Normal file
288
cppdraft/facet/num/get/virtuals.md
Normal file
@@ -0,0 +1,288 @@
|
||||
[facet.num.get.virtuals]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.num.get.virtuals)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.num.get.virtuals)
|
||||
|
||||
#### 28.3.4.3 The numeric category [[category.numeric]](category.numeric#facet.num.get.virtuals)
|
||||
|
||||
#### 28.3.4.3.2 Class template num_get [[locale.num.get]](locale.num.get#facet.num.get.virtuals)
|
||||
|
||||
#### 28.3.4.3.2.3 Virtual functions [facet.num.get.virtuals]
|
||||
|
||||
[ð](#lib:num_get,do_get)
|
||||
|
||||
`iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, long& val) const;
|
||||
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, long long& val) const;
|
||||
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, unsigned short& val) const;
|
||||
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, unsigned int& val) const;
|
||||
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, unsigned long& val) const;
|
||||
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, unsigned long long& val) const;
|
||||
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, float& val) const;
|
||||
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, double& val) const;
|
||||
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, long double& val) const;
|
||||
iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, void*& val) const;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2555)
|
||||
|
||||
*Effects*: Reads characters from in,
|
||||
interpreting them according tostr.flags(),use_facet<ctype<charT>>(loc), anduse_facet<numpunct<charT>>(loc),
|
||||
where loc is str.getloc()[.](#1.sentence-1)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2564)
|
||||
|
||||
The details of this operation occur in three stages:
|
||||
|
||||
- [(2.1)](#2.1)
|
||||
|
||||
Stage 1:
|
||||
Determine a conversion specifier[.](#2.1.sentence-1)
|
||||
|
||||
- [(2.2)](#2.2)
|
||||
|
||||
Stage 2:
|
||||
Extract characters from in and
|
||||
determine a corresponding char value for
|
||||
the format expected by the conversion specification determined in stage 1[.](#2.2.sentence-1)
|
||||
|
||||
- [(2.3)](#2.3)
|
||||
|
||||
Stage 3:
|
||||
Store results[.](#2.3.sentence-1)
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2581)
|
||||
|
||||
The details of the stages are presented below[.](#3.sentence-1)
|
||||
|
||||
- [Stage 1:](#3.1)
|
||||
The function initializes local variables viafmtflags flags = str.flags();
|
||||
fmtflags basefield = (flags & ios_base::basefield);
|
||||
fmtflags uppercase = (flags & ios_base::uppercase);
|
||||
fmtflags boolalpha = (flags & ios_base::boolalpha);
|
||||
For conversion to an integral type,
|
||||
the function determines the integral conversion specifier
|
||||
as indicated in Table [95](#tab:facet.num.get.int "Table 95: Integer conversions")[.](#3.1.sentence-2)
|
||||
The table is ordered[.](#3.1.sentence-3)
|
||||
That is, the first line whose condition is true applies[.](#3.1.sentence-4)
|
||||
Table [95](#tab:facet.num.get.int) — Integer conversions [[tab:facet.num.get.int]](./tab:facet.num.get.int)
|
||||
|
||||
| [ð](#tab:facet.num.get.int-row-1)<br> **State** | **stdio equivalent** |
|
||||
| --- | --- |
|
||||
| [ð](#tab:facet.num.get.int-row-2)<br> basefield == oct | %o |
|
||||
| [ð](#tab:facet.num.get.int-row-3)<br> basefield == hex | %X |
|
||||
| [ð](#tab:facet.num.get.int-row-4)<br> basefield == 0 | %i |
|
||||
| [ð](#tab:facet.num.get.int-row-5)<br> signed integral type | %d |
|
||||
| [ð](#tab:facet.num.get.int-row-6)<br> unsigned integral type | %u |
|
||||
|
||||
For conversions to a floating-point type the specifier is %g[.](#3.1.sentence-5)
|
||||
For conversions to void* the specifier is %p[.](#3.1.sentence-6)
|
||||
A length modifier is added to the conversion specification, if needed,
|
||||
as indicated in Table [96](#tab:facet.num.get.length "Table 96: Length modifier")[.](#3.1.sentence-7)
|
||||
Table [96](#tab:facet.num.get.length) — Length modifier [[tab:facet.num.get.length]](./tab:facet.num.get.length)
|
||||
|
||||
| [ð](#tab:facet.num.get.length-row-1)<br> **Type** | **Length modifier** |
|
||||
| --- | --- |
|
||||
| [ð](#tab:facet.num.get.length-row-2)<br> short | h |
|
||||
| [ð](#tab:facet.num.get.length-row-3)<br> unsigned short | h |
|
||||
| [ð](#tab:facet.num.get.length-row-4)<br> long | l |
|
||||
| [ð](#tab:facet.num.get.length-row-5)<br> unsigned long | l |
|
||||
| [ð](#tab:facet.num.get.length-row-6)<br> long long | ll |
|
||||
| [ð](#tab:facet.num.get.length-row-7)<br> unsigned long long | ll |
|
||||
| [ð](#tab:facet.num.get.length-row-8)<br> double | l |
|
||||
| [ð](#tab:facet.num.get.length-row-9)<br> long double | L |
|
||||
|
||||
- [Stage 2:](#3.2)
|
||||
If in == end then stage 2 terminates[.](#3.2.sentence-1)
|
||||
Otherwise a charT is taken from in and
|
||||
local variables are initialized as if bychar_type ct = *in;char c = src[find(atoms, atoms + sizeof(src) - 1, ct) - atoms];if (ct == use_facet<numpunct<charT>>(loc).decimal_point()) c = '.';bool discard = ct == use_facet<numpunct<charT>>(loc).thousands_sep()&& use_facet<numpunct<charT>>(loc).grouping().length() != 0; where the values src and atoms are defined as if by:static const char src[] = "0123456789abcdefpxABCDEFPX+-";
|
||||
char_type atoms[sizeof(src)];
|
||||
use_facet<ctype<charT>>(loc).widen(src, src + sizeof(src), atoms); for this value of loc[.](#3.2.sentence-2)
|
||||
If discard is true,
|
||||
then if '.' has not yet been accumulated,
|
||||
then the position of the character is remembered,
|
||||
but the character is otherwise ignored[.](#3.2.sentence-3)
|
||||
Otherwise, if '.' has already been accumulated,
|
||||
the character is discarded and Stage 2 terminates[.](#3.2.sentence-4)
|
||||
If it is not discarded,
|
||||
then a check is made to determine
|
||||
if c is allowed as the next character of
|
||||
an input field of the conversion specifier returned by Stage 1[.](#3.2.sentence-5)
|
||||
If so, it is accumulated[.](#3.2.sentence-6)
|
||||
If the character is either discarded or accumulated
|
||||
then in is advanced by ++in and processing returns to the beginning of stage 2[.](#3.2.sentence-7)
|
||||
[*Example [1](#example-1)*:
|
||||
Given an input sequence of "0x1a.bp+07p",
|
||||
* [(3.2.1)](#3.2.1)
|
||||
|
||||
if the conversion specifier returned by Stage 1 is %d,"0" is accumulated;
|
||||
|
||||
* [(3.2.2)](#3.2.2)
|
||||
|
||||
if the conversion specifier returned by Stage 1 is %i,"0x1a" are accumulated;
|
||||
|
||||
* [(3.2.3)](#3.2.3)
|
||||
|
||||
if the conversion specifier returned by Stage 1 is %g,"0x1a.bp+07" are accumulated[.](#3.2.sentence-8)
|
||||
|
||||
In all cases, the remainder is left in the input[.](#3.2.sentence-9)
|
||||
â *end example*]
|
||||
|
||||
- [Stage 3:](#3.3)
|
||||
The sequence of chars accumulated in stage 2 (the field)
|
||||
is converted to a numeric value by the rules of one of the functions
|
||||
declared in the header [<cstdlib>](cstdlib.syn#header:%3ccstdlib%3e "17.2.2 Header <cstdlib> synopsis [cstdlib.syn]"):
|
||||
|
||||
* [(3.3.1)](#3.3.1)
|
||||
|
||||
For a signed integer value, the function strtoll[.](#3.3.1.sentence-1)
|
||||
|
||||
* [(3.3.2)](#3.3.2)
|
||||
|
||||
For an unsigned integer value, the function strtoull[.](#3.3.2.sentence-1)
|
||||
|
||||
* [(3.3.3)](#3.3.3)
|
||||
|
||||
For a float value, the function strtof[.](#3.3.3.sentence-1)
|
||||
|
||||
* [(3.3.4)](#3.3.4)
|
||||
|
||||
For a double value, the function strtod[.](#3.3.4.sentence-1)
|
||||
|
||||
* [(3.3.5)](#3.3.5)
|
||||
|
||||
For a long double value, the function strtold[.](#3.3.5.sentence-1)
|
||||
|
||||
The numeric value to be stored can be one of:
|
||||
* [(3.3.6)](#3.3.6)
|
||||
|
||||
zero, if the conversion function does not convert the entire field[.](#3.3.6.sentence-1)
|
||||
|
||||
* [(3.3.7)](#3.3.7)
|
||||
|
||||
the most positive (or negative) representable value,
|
||||
if the field to be converted to a signed integer type represents a value
|
||||
too large positive (or negative) to be represented in val[.](#3.3.7.sentence-1)
|
||||
|
||||
* [(3.3.8)](#3.3.8)
|
||||
|
||||
the most positive representable value,
|
||||
if the field to be converted to an unsigned integer type represents a value
|
||||
that cannot be represented in val[.](#3.3.8.sentence-1)
|
||||
|
||||
* [(3.3.9)](#3.3.9)
|
||||
|
||||
the converted value, otherwise[.](#3.3.9.sentence-1)
|
||||
|
||||
The resultant numeric value is stored in val[.](#3.3.sentence-3)
|
||||
If the conversion function does not convert the entire field, or
|
||||
if the field represents a value outside the range of representable values,ios_base::failbit is assigned to err[.](#3.3.sentence-4)
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2726)
|
||||
|
||||
Digit grouping is checked[.](#4.sentence-1)
|
||||
|
||||
That is, the positions of discarded
|
||||
separators are examined for consistency withuse_facet<numpunct<charT>>(loc).grouping()[.](#4.sentence-2)
|
||||
|
||||
If they are not consistent
|
||||
then ios_base::failbit is assigned to err[.](#4.sentence-3)
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2734)
|
||||
|
||||
In any case,
|
||||
if stage 2 processing was terminated by the test for in == end then err |= ios_base::eofbit is performed[.](#5.sentence-1)
|
||||
|
||||
[ð](#lib:do_get,num_get_)
|
||||
|
||||
`iter_type do_get(iter_type in, iter_type end, ios_base& str,
|
||||
ios_base::iostate& err, bool& val) const;
|
||||
`
|
||||
|
||||
[6](#6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2747)
|
||||
|
||||
*Effects*: If (str.flags() & ios_base::boolalpha) == 0 then input proceeds as it would for a long except that if a value is being stored into val,
|
||||
the value is determined according to the following:
|
||||
If the value to be stored is 0 then false is stored[.](#6.sentence-1)
|
||||
|
||||
If the value is 1 then true is stored[.](#6.sentence-2)
|
||||
|
||||
Otherwise true is stored andios_base::failbit is assigned to err[.](#6.sentence-3)
|
||||
|
||||
[7](#7)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2758)
|
||||
|
||||
Otherwise target sequences are determined âas ifâ by
|
||||
calling the members falsename() and truename() of
|
||||
the facet obtained by use_facet<numpunct<charT>>(str.getloc())[.](#7.sentence-1)
|
||||
|
||||
Successive characters in the range [in, end) (see [[sequence.reqmts]](sequence.reqmts "23.2.4 Sequence containers"))
|
||||
are obtained and matched against
|
||||
corresponding positions in the target sequences
|
||||
only as necessary to identify a unique match[.](#7.sentence-2)
|
||||
|
||||
The input iterator in is compared to end only when necessary to obtain a character[.](#7.sentence-3)
|
||||
|
||||
If a target sequence is uniquely matched,val is set to the corresponding value[.](#7.sentence-4)
|
||||
|
||||
Otherwise false is stored andios_base::failbit is assigned to err[.](#7.sentence-5)
|
||||
|
||||
[8](#8)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2773)
|
||||
|
||||
The in iterator is always left pointing one position beyond
|
||||
the last character successfully matched[.](#8.sentence-1)
|
||||
|
||||
If val is set, then err is set to str.goodbit;
|
||||
or to str.eofbit if,
|
||||
when seeking another character to match,
|
||||
it is found that (in == end)[.](#8.sentence-2)
|
||||
|
||||
If val is not set, then err is set to str.failbit;
|
||||
or to (str.failbit | str.eofbit) if the reason for the failure was that (in == end)[.](#8.sentence-3)
|
||||
|
||||
[*Example [2](#example-2)*:
|
||||
|
||||
For targets true: "a" and false: "abb",
|
||||
the input sequence "a" yieldsval == true and err == str.eofbit;
|
||||
the input sequence "abc" yieldserr = str.failbit, with in ending at the 'c' element[.](#8.sentence-4)
|
||||
|
||||
For targets true: "1" and false: "0",
|
||||
the input sequence "1" yieldsval == true and err == str.goodbit[.](#8.sentence-5)
|
||||
|
||||
For empty targets (""),
|
||||
any input sequence yields err == str.failbit[.](#8.sentence-6)
|
||||
|
||||
â *end example*]
|
||||
|
||||
[9](#9)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2796)
|
||||
|
||||
*Returns*: in[.](#9.sentence-1)
|
||||
31
cppdraft/facet/num/put/members.md
Normal file
31
cppdraft/facet/num/put/members.md
Normal file
@@ -0,0 +1,31 @@
|
||||
[facet.num.put.members]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.num.put.members)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.num.put.members)
|
||||
|
||||
#### 28.3.4.3 The numeric category [[category.numeric]](category.numeric#facet.num.put.members)
|
||||
|
||||
#### 28.3.4.3.3 Class template num_put [[locale.nm.put]](locale.nm.put#facet.num.put.members)
|
||||
|
||||
#### 28.3.4.3.3.2 Members [facet.num.put.members]
|
||||
|
||||
[ð](#lib:num_put,put)
|
||||
|
||||
`iter_type put(iter_type out, ios_base& str, char_type fill, bool val) const;
|
||||
iter_type put(iter_type out, ios_base& str, char_type fill, long val) const;
|
||||
iter_type put(iter_type out, ios_base& str, char_type fill, long long val) const;
|
||||
iter_type put(iter_type out, ios_base& str, char_type fill, unsigned long val) const;
|
||||
iter_type put(iter_type out, ios_base& str, char_type fill, unsigned long long val) const;
|
||||
iter_type put(iter_type out, ios_base& str, char_type fill, double val) const;
|
||||
iter_type put(iter_type out, ios_base& str, char_type fill, long double val) const;
|
||||
iter_type put(iter_type out, ios_base& str, char_type fill, const void* val) const;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2861)
|
||||
|
||||
*Returns*: do_put(out, str, fill, val)[.](#1.sentence-1)
|
||||
204
cppdraft/facet/num/put/virtuals.md
Normal file
204
cppdraft/facet/num/put/virtuals.md
Normal file
@@ -0,0 +1,204 @@
|
||||
[facet.num.put.virtuals]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.num.put.virtuals)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.num.put.virtuals)
|
||||
|
||||
#### 28.3.4.3 The numeric category [[category.numeric]](category.numeric#facet.num.put.virtuals)
|
||||
|
||||
#### 28.3.4.3.3 Class template num_put [[locale.nm.put]](locale.nm.put#facet.num.put.virtuals)
|
||||
|
||||
#### 28.3.4.3.3.3 Virtual functions [facet.num.put.virtuals]
|
||||
|
||||
[ð](#lib:num_put,do_put)
|
||||
|
||||
`iter_type do_put(iter_type out, ios_base& str, char_type fill, long val) const;
|
||||
iter_type do_put(iter_type out, ios_base& str, char_type fill, long long val) const;
|
||||
iter_type do_put(iter_type out, ios_base& str, char_type fill, unsigned long val) const;
|
||||
iter_type do_put(iter_type out, ios_base& str, char_type fill, unsigned long long val) const;
|
||||
iter_type do_put(iter_type out, ios_base& str, char_type fill, double val) const;
|
||||
iter_type do_put(iter_type out, ios_base& str, char_type fill, long double val) const;
|
||||
iter_type do_put(iter_type out, ios_base& str, char_type fill, const void* val) const;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2880)
|
||||
|
||||
*Effects*: Writes characters to the sequence out,
|
||||
formatting val as desired[.](#1.sentence-1)
|
||||
|
||||
In the following description, loc names a local variable initialized aslocale loc = str.getloc();
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2889)
|
||||
|
||||
The details of this operation occur in several stages:
|
||||
|
||||
- [(2.1)](#2.1)
|
||||
|
||||
Stage 1:
|
||||
Determine a printf conversion specifier spec and
|
||||
determine the characters
|
||||
that would be printed by printf ([[c.files]](c.files "31.13 C library files"))
|
||||
given this conversion specifier forprintf(spec, val) assuming that the current locale is the "C" locale[.](#2.1.sentence-1)
|
||||
|
||||
- [(2.2)](#2.2)
|
||||
|
||||
Stage 2:
|
||||
Adjust the representation by converting
|
||||
each char determined by stage 1 to a charT using a conversion and
|
||||
values returned by members of use_facet<numpunct<charT>>(loc)[.](#2.2.sentence-1)
|
||||
|
||||
- [(2.3)](#2.3)
|
||||
|
||||
Stage 3:
|
||||
Determine where padding is required[.](#2.3.sentence-1)
|
||||
|
||||
- [(2.4)](#2.4)
|
||||
|
||||
Stage 4:
|
||||
Insert the sequence into the out[.](#2.4.sentence-1)
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2917)
|
||||
|
||||
Detailed descriptions of each stage follow[.](#3.sentence-1)
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2920)
|
||||
|
||||
*Returns*: out[.](#4.sentence-1)
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L2924)
|
||||
|
||||
- [Stage 1:](#5.1)
|
||||
The first action of stage 1 is to determine a conversion specifier[.](#5.1.sentence-1)
|
||||
The tables that describe this determination use the following local variables
|
||||
fmtflags flags = str.flags();
|
||||
fmtflags basefield = (flags & (ios_base::basefield));
|
||||
fmtflags uppercase = (flags & (ios_base::uppercase));
|
||||
fmtflags floatfield = (flags & (ios_base::floatfield));
|
||||
fmtflags showpos = (flags & (ios_base::showpos));
|
||||
fmtflags showbase = (flags & (ios_base::showbase));
|
||||
fmtflags showpoint = (flags & (ios_base::showpoint));
|
||||
All tables used in describing stage 1 are ordered[.](#5.1.sentence-3)
|
||||
That is, the first line whose condition is true applies[.](#5.1.sentence-4)
|
||||
A line without a condition is the default behavior
|
||||
when none of the earlier lines apply[.](#5.1.sentence-5)
|
||||
For conversion from an integral type other than a character type,
|
||||
the function determines the integral conversion specifier
|
||||
as indicated in Table [97](#tab:facet.num.put.int "Table 97: Integer conversions")[.](#5.1.sentence-6)
|
||||
Table [97](#tab:facet.num.put.int) — Integer conversions [[tab:facet.num.put.int]](./tab:facet.num.put.int)
|
||||
|
||||
| [ð](#tab:facet.num.put.int-row-1)<br> **State** | **stdio equivalent** |
|
||||
| --- | --- |
|
||||
| [ð](#tab:facet.num.put.int-row-2)<br> basefield == ios_base::oct | %o |
|
||||
| [ð](#tab:facet.num.put.int-row-3)<br> (basefield == ios_base::hex) && !uppercase | %x |
|
||||
| [ð](#tab:facet.num.put.int-row-4)<br> (basefield == ios_base::hex) | %X |
|
||||
| [ð](#tab:facet.num.put.int-row-5)<br> for a signed integral type | %d |
|
||||
| [ð](#tab:facet.num.put.int-row-6)<br> for an unsigned integral type | %u |
|
||||
|
||||
For conversion from a floating-point type,
|
||||
the function determines the floating-point conversion specifier
|
||||
as indicated in Table [98](#tab:facet.num.put.fp "Table 98: Floating-point conversions")[.](#5.1.sentence-7)
|
||||
Table [98](#tab:facet.num.put.fp) — Floating-point conversions [[tab:facet.num.put.fp]](./tab:facet.num.put.fp)
|
||||
|
||||
| [ð](#tab:facet.num.put.fp-row-1)<br> **State** | **stdio equivalent** |
|
||||
| --- | --- |
|
||||
| [ð](#tab:facet.num.put.fp-row-2)<br> floatfield == ios_base::fixed && !uppercase | %f |
|
||||
| [ð](#tab:facet.num.put.fp-row-3)<br> floatfield == ios_base::fixed | %F |
|
||||
| [ð](#tab:facet.num.put.fp-row-4)<br> floatfield == ios_base::scientific && !uppercase | %e |
|
||||
| [ð](#tab:facet.num.put.fp-row-5)<br> floatfield == ios_base::scientific | %E |
|
||||
| [ð](#tab:facet.num.put.fp-row-6)<br> floatfield == (ios_base::fixed | ios_base::scientific) && !uppercase | %a |
|
||||
| [ð](#tab:facet.num.put.fp-row-7)<br> floatfield == (ios_base::fixed | ios_base::scientific) | %A |
|
||||
| [ð](#tab:facet.num.put.fp-row-8)<br> !uppercase | %g |
|
||||
| [ð](#tab:facet.num.put.fp-row-9)<br> *otherwise* | %G |
|
||||
|
||||
For conversions from an integral or floating-point type
|
||||
a length modifier is added to the conversion specifier
|
||||
as indicated in Table [99](#tab:facet.num.put.length "Table 99: Length modifier")[.](#5.1.sentence-8)
|
||||
Table [99](#tab:facet.num.put.length) — Length modifier [[tab:facet.num.put.length]](./tab:facet.num.put.length)
|
||||
|
||||
| [ð](#tab:facet.num.put.length-row-1)<br> **Type** | **Length modifier** |
|
||||
| --- | --- |
|
||||
| [ð](#tab:facet.num.put.length-row-2)<br> long | l |
|
||||
| [ð](#tab:facet.num.put.length-row-3)<br> long long | ll |
|
||||
| [ð](#tab:facet.num.put.length-row-4)<br> unsigned long | l |
|
||||
| [ð](#tab:facet.num.put.length-row-5)<br> unsigned long long | ll |
|
||||
| [ð](#tab:facet.num.put.length-row-6)<br> long double | L |
|
||||
| [ð](#tab:facet.num.put.length-row-7)<br> *otherwise* | *none* |
|
||||
|
||||
The conversion specifier has the following optional additional qualifiers
|
||||
prepended as indicated in Table [100](#tab:facet.num.put.conv "Table 100: Numeric conversions")[.](#5.1.sentence-9)
|
||||
Table [100](#tab:facet.num.put.conv) — Numeric conversions [[tab:facet.num.put.conv]](./tab:facet.num.put.conv)
|
||||
|
||||
| [ð](#tab:facet.num.put.conv-row-1)<br> **Type(s)** | **State** | **stdio equivalent** |
|
||||
| --- | --- | --- |
|
||||
| [ð](#tab:facet.num.put.conv-row-2)<br> an integral type | showpos | + |
|
||||
| [ð](#tab:facet.num.put.conv-row-3) | showbase | # |
|
||||
| [ð](#tab:facet.num.put.conv-row-4)<br> a floating-point type | showpos | + |
|
||||
| [ð](#tab:facet.num.put.conv-row-5) | showpoint | # |
|
||||
|
||||
For conversion from a floating-point type,
|
||||
if floatfield != (ios_base::fixed | ios_base::scientific),str.precision() is specified as precision
|
||||
in the conversion specification[.](#5.1.sentence-10)
|
||||
Otherwise, no precision is specified[.](#5.1.sentence-11)
|
||||
For conversion from void* the specifier is %p[.](#5.1.sentence-12)
|
||||
The representations at the end of stage 1 consists of the char's
|
||||
that would be printed by a call of printf(s, val) where s is the conversion specifier determined above[.](#5.1.sentence-13)
|
||||
|
||||
- [Stage 2:](#5.2)
|
||||
Any character c other than a decimal point(.) is converted to
|
||||
a charT viause_facet<ctype<charT>>(loc).widen(c)
|
||||
A local variable punct is initialized viaconst numpunct<charT>& punct = use_facet<numpunct<charT>>(loc);
|
||||
For arithmetic types,punct.thousands_sep() characters are inserted into
|
||||
the sequence as determined by the value returned by punct.do_grouping() using the method described in [[facet.numpunct.virtuals]](facet.numpunct.virtuals "28.3.4.4.1.3 Virtual functions")[.](#5.2.sentence-3)
|
||||
Decimal point characters(.) are replaced by punct.decimal_point()[.](#5.2.sentence-4)
|
||||
|
||||
- [Stage 3:](#5.3)
|
||||
A local variable is initialized asfmtflags adjustfield = (flags & (ios_base::adjustfield));
|
||||
The location of any padding[224](#footnote-224 "The conversion specification #o generates a leading 0 which is not a padding character.") is determined according to Table [101](#tab:facet.num.put.fill "Table 101: Fill padding")[.](#5.3.sentence-2)
|
||||
Table [101](#tab:facet.num.put.fill) — Fill padding [[tab:facet.num.put.fill]](./tab:facet.num.put.fill)
|
||||
|
||||
| [ð](#tab:facet.num.put.fill-row-1)<br> **State** | **Location** |
|
||||
| --- | --- |
|
||||
| [ð](#tab:facet.num.put.fill-row-2)<br> adjustfield == ios_base::left | pad after |
|
||||
| [ð](#tab:facet.num.put.fill-row-3)<br> adjustfield == ios_base::right | pad before |
|
||||
| [ð](#tab:facet.num.put.fill-row-4)<br> adjustfield == internal and a sign occurs in the representation | pad after the sign |
|
||||
| [ð](#tab:facet.num.put.fill-row-5)<br> adjustfield == internal and representation after stage 1 began with 0x or 0X | pad after x or X |
|
||||
| [ð](#tab:facet.num.put.fill-row-6)<br> *otherwise* | pad before |
|
||||
|
||||
If str.width() is nonzero and the number of charT's
|
||||
in the sequence after stage 2 is less than str.width(),
|
||||
then enough fill characters are added to the sequence
|
||||
at the position indicated for padding
|
||||
to bring the length of the sequence to str.width()[.](#5.3.sentence-3)
|
||||
str.width(0) is called[.](#5.3.sentence-4)
|
||||
|
||||
- [Stage 4:](#5.4)
|
||||
The sequence of charT's at the end of stage 3 are output via*out++ = c
|
||||
|
||||
[ð](#lib:do_put,num_put_)
|
||||
|
||||
`iter_type do_put(iter_type out, ios_base& str, char_type fill, bool val) const;
|
||||
`
|
||||
|
||||
[6](#6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3086)
|
||||
|
||||
*Returns*: If (str.flags() & ios_base::boolalpha) == 0 returns do_put(out, str, fill,
|
||||
(int)val),
|
||||
otherwise obtains a string s as if bystring_type s = val ? use_facet<numpunct<charT>>(loc).truename(): use_facet<numpunct<charT>>(loc).falsename(); and then inserts each character c of s into out via *out++ = c and returns out[.](#6.sentence-1)
|
||||
|
||||
[224)](#footnote-224)[224)](#footnoteref-224)
|
||||
|
||||
The conversion specification #o generates a leading 0 which is *not* a padding character[.](#footnote-224.sentence-1)
|
||||
216
cppdraft/facet/numpunct.md
Normal file
216
cppdraft/facet/numpunct.md
Normal file
@@ -0,0 +1,216 @@
|
||||
[facet.numpunct]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.numpunct)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.numpunct)
|
||||
|
||||
#### 28.3.4.4 The numeric punctuation facet [facet.numpunct]
|
||||
|
||||
#### [28.3.4.4.1](#locale.numpunct) Class template numpunct [[locale.numpunct]](locale.numpunct)
|
||||
|
||||
#### [28.3.4.4.1.1](#locale.numpunct.general) General [[locale.numpunct.general]](locale.numpunct.general)
|
||||
|
||||
[ð](#lib:numpunct)
|
||||
|
||||
namespace std {template<class charT>class numpunct : public locale::facet {public:using char_type = charT; using string_type = basic_string<charT>; explicit numpunct(size_t refs = 0);
|
||||
|
||||
char_type decimal_point() const;
|
||||
char_type thousands_sep() const;
|
||||
string grouping() const;
|
||||
string_type truename() const;
|
||||
string_type falsename() const; static locale::id id; protected:~numpunct(); // virtualvirtual char_type do_decimal_point() const; virtual char_type do_thousands_sep() const; virtual string do_grouping() const; virtual string_type do_truename() const; // for boolvirtual string_type do_falsename() const; // for bool};}
|
||||
|
||||
[1](#locale.numpunct.general-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3137)
|
||||
|
||||
numpunct<> specifies numeric punctuation[.](#locale.numpunct.general-1.sentence-1)
|
||||
|
||||
The specializations
|
||||
required in Table [91](locale.category#tab:locale.category.facets "Table 91: Locale category facets") ([[locale.category]](locale.category "28.3.3.1.2.1 Type locale::category")),
|
||||
namely numpunct<wchar_t> and numpunct<char>,
|
||||
provide classic "C" numeric formats,
|
||||
i.e., they contain information
|
||||
equivalent to that contained in the "C" locale or
|
||||
their wide character counterparts as if obtained by a call to widen[.](#locale.numpunct.general-1.sentence-2)
|
||||
|
||||
[2](#locale.numpunct.general-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3153)
|
||||
|
||||
The syntax for number formats is as follows,
|
||||
where *digit* represents the radix set
|
||||
specified by the fmtflags argument value, and*thousands-sep* and *decimal-point* are the results of corresponding numpunct<charT> members[.](#locale.numpunct.general-2.sentence-1)
|
||||
|
||||
Integer values have the format:
|
||||
|
||||
intval :
|
||||
[*sign*](lex.fcon#nt:sign "5.13.4 Floating-point literals [lex.fcon]")opt units
|
||||
|
||||
[*sign*](lex.fcon#nt:sign "5.13.4 Floating-point literals [lex.fcon]") :
|
||||
+
|
||||
-
|
||||
|
||||
units :
|
||||
digits
|
||||
digits thousands-sep units
|
||||
|
||||
digits :
|
||||
[*digit*](lex.name#nt:digit "5.11 Identifiers [lex.name]") digitsopt
|
||||
|
||||
and floating-point values have:
|
||||
|
||||
floatval :
|
||||
[*sign*](lex.fcon#nt:sign "5.13.4 Floating-point literals [lex.fcon]")opt units fractionalopt exponentopt
|
||||
[*sign*](lex.fcon#nt:sign "5.13.4 Floating-point literals [lex.fcon]")opt decimal-point digits exponentopt
|
||||
|
||||
fractional :
|
||||
decimal-point digitsopt
|
||||
|
||||
exponent :
|
||||
e [*sign*](lex.fcon#nt:sign "5.13.4 Floating-point literals [lex.fcon]")opt digits
|
||||
|
||||
e :
|
||||
e
|
||||
E
|
||||
|
||||
where the number of digits between *thousands-sep**s* is as specified by do_grouping()[.](#locale.numpunct.general-2.sentence-2)
|
||||
|
||||
For parsing,
|
||||
if the *digits* portion contains no thousands-separators,
|
||||
no grouping constraint is applied[.](#locale.numpunct.general-2.sentence-3)
|
||||
|
||||
#### [28.3.4.4.1.2](#members) Members [[facet.numpunct.members]](facet.numpunct.members)
|
||||
|
||||
[ð](#lib:numpunct,decimal_point)
|
||||
|
||||
`char_type decimal_point() const;
|
||||
`
|
||||
|
||||
[1](#members-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3211)
|
||||
|
||||
*Returns*: do_decimal_point()[.](#members-1.sentence-1)
|
||||
|
||||
[ð](#lib:numpunct,thousands_sep)
|
||||
|
||||
`char_type thousands_sep() const;
|
||||
`
|
||||
|
||||
[2](#members-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3222)
|
||||
|
||||
*Returns*: do_thousands_sep()[.](#members-2.sentence-1)
|
||||
|
||||
[ð](#lib:numpunct,grouping)
|
||||
|
||||
`string grouping() const;
|
||||
`
|
||||
|
||||
[3](#members-3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3233)
|
||||
|
||||
*Returns*: do_grouping()[.](#members-3.sentence-1)
|
||||
|
||||
[ð](#lib:numpunct,truename)
|
||||
|
||||
`string_type truename() const;
|
||||
string_type falsename() const;
|
||||
`
|
||||
|
||||
[4](#members-4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3246)
|
||||
|
||||
*Returns*: do_truename() ordo_falsename(),
|
||||
respectively[.](#members-4.sentence-1)
|
||||
|
||||
#### [28.3.4.4.1.3](#virtuals) Virtual functions [[facet.numpunct.virtuals]](facet.numpunct.virtuals)
|
||||
|
||||
[ð](#lib:numpunct,do_decimal_point)
|
||||
|
||||
`char_type do_decimal_point() const;
|
||||
`
|
||||
|
||||
[1](#virtuals-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3262)
|
||||
|
||||
*Returns*: A character for use as the decimal radix separator[.](#virtuals-1.sentence-1)
|
||||
|
||||
The required specializations return '.' or L'.'[.](#virtuals-1.sentence-2)
|
||||
|
||||
[ð](#lib:numpunct,do_thousands_sep)
|
||||
|
||||
`char_type do_thousands_sep() const;
|
||||
`
|
||||
|
||||
[2](#virtuals-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3274)
|
||||
|
||||
*Returns*: A character for use as the digit group separator[.](#virtuals-2.sentence-1)
|
||||
|
||||
The required specializations return ',' or L','[.](#virtuals-2.sentence-2)
|
||||
|
||||
[ð](#lib:numpunct,do_grouping)
|
||||
|
||||
`string do_grouping() const;
|
||||
`
|
||||
|
||||
[3](#virtuals-3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3286)
|
||||
|
||||
*Returns*: A string vec used as a vector of integer values,
|
||||
in which each element vec[i] represents the number of digits[225](#footnote-225 "Thus, the string "\003" specifies groups of 3 digits each, and "3" probably indicates groups of 51 (!) digits each, because 51 is the ASCII value of "3".") in the group at position i,
|
||||
starting with position 0 as the rightmost group[.](#virtuals-3.sentence-1)
|
||||
|
||||
If vec.size() <= i,
|
||||
the number is the same as group (i - 1);
|
||||
if (i < 0 || vec[i] <= 0 || vec[i] == CHAR_MAX),
|
||||
the size of the digit group is unlimited[.](#virtuals-3.sentence-2)
|
||||
|
||||
[4](#virtuals-4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3303)
|
||||
|
||||
The required specializations return the empty string, indicating no grouping[.](#virtuals-4.sentence-1)
|
||||
|
||||
[ð](#lib:numpunct,do_truename)
|
||||
|
||||
`string_type do_truename() const;
|
||||
string_type do_falsename() const;
|
||||
`
|
||||
|
||||
[5](#virtuals-5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3315)
|
||||
|
||||
*Returns*: A string representing the name of
|
||||
the boolean value true or false, respectively[.](#virtuals-5.sentence-1)
|
||||
|
||||
[6](#virtuals-6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3320)
|
||||
|
||||
In the base class implementation
|
||||
these names are "true" and "false",
|
||||
or L"true" and L"false"[.](#virtuals-6.sentence-1)
|
||||
|
||||
[225)](#footnote-225)[225)](#footnoteref-225)
|
||||
|
||||
Thus,
|
||||
the string "\003" specifies groups of 3 digits each, and"3" probably indicates groups of 51 (!) digits each,
|
||||
because 51 is the ASCII value of "3"[.](#footnote-225.sentence-1)
|
||||
|
||||
#### [28.3.4.4.2](#locale.numpunct.byname) Class template numpunct_byname [[locale.numpunct.byname]](locale.numpunct.byname)
|
||||
|
||||
[ð](#lib:numpunct_byname)
|
||||
|
||||
namespace std {template<class charT>class numpunct_byname : public numpunct<charT> {// this class is specialized for char and wchar_t.public:using char_type = charT; using string_type = basic_string<charT>; explicit numpunct_byname(const char*, size_t refs = 0); explicit numpunct_byname(const string&, size_t refs = 0); protected:~numpunct_byname(); };}
|
||||
59
cppdraft/facet/numpunct/members.md
Normal file
59
cppdraft/facet/numpunct/members.md
Normal file
@@ -0,0 +1,59 @@
|
||||
[facet.numpunct.members]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.numpunct.members)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.numpunct.members)
|
||||
|
||||
#### 28.3.4.4 The numeric punctuation facet [[facet.numpunct]](facet.numpunct#members)
|
||||
|
||||
#### 28.3.4.4.1 Class template numpunct [[locale.numpunct]](locale.numpunct#facet.numpunct.members)
|
||||
|
||||
#### 28.3.4.4.1.2 Members [facet.numpunct.members]
|
||||
|
||||
[ð](#lib:numpunct,decimal_point)
|
||||
|
||||
`char_type decimal_point() const;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3211)
|
||||
|
||||
*Returns*: do_decimal_point()[.](#1.sentence-1)
|
||||
|
||||
[ð](#lib:numpunct,thousands_sep)
|
||||
|
||||
`char_type thousands_sep() const;
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3222)
|
||||
|
||||
*Returns*: do_thousands_sep()[.](#2.sentence-1)
|
||||
|
||||
[ð](#lib:numpunct,grouping)
|
||||
|
||||
`string grouping() const;
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3233)
|
||||
|
||||
*Returns*: do_grouping()[.](#3.sentence-1)
|
||||
|
||||
[ð](#lib:numpunct,truename)
|
||||
|
||||
`string_type truename() const;
|
||||
string_type falsename() const;
|
||||
`
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3246)
|
||||
|
||||
*Returns*: do_truename() ordo_falsename(),
|
||||
respectively[.](#4.sentence-1)
|
||||
90
cppdraft/facet/numpunct/virtuals.md
Normal file
90
cppdraft/facet/numpunct/virtuals.md
Normal file
@@ -0,0 +1,90 @@
|
||||
[facet.numpunct.virtuals]
|
||||
|
||||
# 28 Text processing library [[text]](./#text)
|
||||
|
||||
## 28.3 Localization library [[localization]](localization#facet.numpunct.virtuals)
|
||||
|
||||
### 28.3.4 Standard locale categories [[locale.categories]](locale.categories#facet.numpunct.virtuals)
|
||||
|
||||
#### 28.3.4.4 The numeric punctuation facet [[facet.numpunct]](facet.numpunct#virtuals)
|
||||
|
||||
#### 28.3.4.4.1 Class template numpunct [[locale.numpunct]](locale.numpunct#facet.numpunct.virtuals)
|
||||
|
||||
#### 28.3.4.4.1.3 Virtual functions [facet.numpunct.virtuals]
|
||||
|
||||
[ð](#lib:numpunct,do_decimal_point)
|
||||
|
||||
`char_type do_decimal_point() const;
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3262)
|
||||
|
||||
*Returns*: A character for use as the decimal radix separator[.](#1.sentence-1)
|
||||
|
||||
The required specializations return '.' or L'.'[.](#1.sentence-2)
|
||||
|
||||
[ð](#lib:numpunct,do_thousands_sep)
|
||||
|
||||
`char_type do_thousands_sep() const;
|
||||
`
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3274)
|
||||
|
||||
*Returns*: A character for use as the digit group separator[.](#2.sentence-1)
|
||||
|
||||
The required specializations return ',' or L','[.](#2.sentence-2)
|
||||
|
||||
[ð](#lib:numpunct,do_grouping)
|
||||
|
||||
`string do_grouping() const;
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3286)
|
||||
|
||||
*Returns*: A string vec used as a vector of integer values,
|
||||
in which each element vec[i] represents the number of digits[225](#footnote-225 "Thus, the string "\003" specifies groups of 3 digits each, and "3" probably indicates groups of 51 (!) digits each, because 51 is the ASCII value of "3".") in the group at position i,
|
||||
starting with position 0 as the rightmost group[.](#3.sentence-1)
|
||||
|
||||
If vec.size() <= i,
|
||||
the number is the same as group (i - 1);
|
||||
if (i < 0 || vec[i] <= 0 || vec[i] == CHAR_MAX),
|
||||
the size of the digit group is unlimited[.](#3.sentence-2)
|
||||
|
||||
[4](#4)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3303)
|
||||
|
||||
The required specializations return the empty string, indicating no grouping[.](#4.sentence-1)
|
||||
|
||||
[ð](#lib:numpunct,do_truename)
|
||||
|
||||
`string_type do_truename() const;
|
||||
string_type do_falsename() const;
|
||||
`
|
||||
|
||||
[5](#5)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3315)
|
||||
|
||||
*Returns*: A string representing the name of
|
||||
the boolean value true or false, respectively[.](#5.sentence-1)
|
||||
|
||||
[6](#6)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L3320)
|
||||
|
||||
In the base class implementation
|
||||
these names are "true" and "false",
|
||||
or L"true" and L"false"[.](#6.sentence-1)
|
||||
|
||||
[225)](#footnote-225)[225)](#footnoteref-225)
|
||||
|
||||
Thus,
|
||||
the string "\003" specifies groups of 3 digits each, and"3" probably indicates groups of 51 (!) digits each,
|
||||
because 51 is the ASCII value of "3"[.](#footnote-225.sentence-1)
|
||||
Reference in New Issue
Block a user