aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/doc/xml/manual/ctype.xml
blob: 9cc4603667d95c47da511b7cc7609a852f0c1013 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<section id="std.localization.facet.ctype" xreflabel="ctype">
<?dbhtml filename="ctype.html"?>

<sectioninfo>
  <keywordset>
    <keyword>
      ISO C++
    </keyword>
    <keyword>
      ctype
    </keyword>
  </keywordset>
</sectioninfo>

<title>ctype</title>

<section id="facet.ctype.impl">
<title>Implementation</title>

  <section>
    <title>Specializations</title>

<para>
For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; ,
conversions are made between the internal character set (always UCS4
on GNU/Linux) and whatever the currently selected locale for the
LC_CTYPE category implements.
</para>

<para>
The two required specializations are implemented as follows:
</para>

<para>
<code>
ctype&lt;char&gt;
</code>
</para>
<para>
This is simple specialization. Implementing this was a piece of cake.
</para>

<para>
<code>
ctype&lt;wchar_t&gt;
</code>
</para>
<para>
This specialization, by specifying all the template parameters, pretty
much ties the hands of implementors. As such, the implementation is
straightforward, involving mcsrtombs for the conversions between char
to wchar_t and wcsrtombs for conversions between wchar_t and char.
</para>

<para>
Neither of these two required specializations deals with Unicode
characters.
</para>

  </section>
</section>

<section id="facet.ctype.future">
<title>Future</title>


<itemizedlist>
   <listitem>
   <para>
   How to deal with the global locale issue?
   </para></listitem>

   <listitem>
   <para>
   How to deal with different types than char, wchar_t? </para></listitem>

   <listitem><para>
   Overlap between codecvt/ctype: narrow/widen
   </para></listitem>

   <listitem>
     <para>
       Mask typedef in codecvt_base, argument types in codecvt.  what
       is know about this type?
   </para></listitem>

   <listitem>
   <para>
   Why mask* argument in codecvt?
   </para></listitem>

   <listitem>
     <para>
       Can this be made (more) generic? is there a simple way to
       straighten out the configure-time mess that is a by-product of
       this class?
   </para></listitem>

   <listitem>
     <para>
       Get the ctype&lt;wchar_t&gt;::mask stuff under control. Need to
       make some kind of static table, and not do lookup every time
       somebody hits the do_is... functions. Too bad we can't just
       redefine mask for ctype&lt;wchar_t&gt;
   </para></listitem>

   <listitem>
     <para>
       Rename abstract base class. See if just smash-overriding is a
       better approach. Clarify, add sanity to naming.
     </para>
   </listitem>

</itemizedlist>


</section>


<bibliography id="facet.ctype.biblio">
<title>Bibliography</title>

  <biblioentry>
    <title>
      The GNU C Library
    </title>
    <author>
      <surname>McGrath</surname>
      <firstname>Roland</firstname>
    </author>
    <author>
      <surname>Drepper</surname>
      <firstname>Ulrich</firstname>
    </author>
    <copyright>
      <year>2007</year>
      <holder>FSF</holder>
    </copyright>
    <pagenums>Chapters 6  Character Set Handling and 7 Locales and Internationalization</pagenums>
  </biblioentry>

  <biblioentry>
    <title>
      Correspondence
    </title>
    <author>
      <surname>Drepper</surname>
      <firstname>Ulrich</firstname>
    </author>
    <copyright>
      <year>2002</year>
      <holder></holder>
    </copyright>
  </biblioentry>

  <biblioentry>
    <title>
      ISO/IEC 14882:1998 Programming languages - C++
    </title>
    <copyright>
      <year>1998</year>
      <holder>ISO</holder>
    </copyright>
  </biblioentry>

  <biblioentry>
    <title>
      ISO/IEC 9899:1999 Programming languages - C
    </title>
    <copyright>
      <year>1999</year>
      <holder>ISO</holder>
    </copyright>
  </biblioentry>

  <biblioentry>
    <biblioid class="uri">
      <ulink url="http://www.unix.org/version3/ieee_std.html">
	<citetitle>
	  The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
	</citetitle>
      </ulink>
    </biblioid>
    <copyright>
      <year>1999</year>
      <holder>
      The Open Group/The Institute of Electrical and Electronics Engineers, Inc.</holder>
    </copyright>
  </biblioentry>

  <biblioentry>
    <title>
      The C++ Programming Language, Special Edition
    </title>
    <author>
      <surname>Stroustrup</surname>
      <firstname>Bjarne</firstname>
    </author>
    <copyright>
      <year>2000</year>
      <holder>Addison Wesley, Inc.</holder>
    </copyright>
    <pagenums>Appendix D</pagenums>
    <publisher>
      <publishername>
	Addison Wesley
      </publishername>
    </publisher>
  </biblioentry>

  <biblioentry>
    <title>
      Standard C++ IOStreams and Locales
    </title>
    <subtitle>
      Advanced Programmer's Guide and Reference
    </subtitle>
    <author>
      <surname>Langer</surname>
      <firstname>Angelika</firstname>
    </author>
    <author>
      <surname>Kreft</surname>
      <firstname>Klaus</firstname>
    </author>
    <copyright>
      <year>2000</year>
      <holder>Addison Wesley Longman, Inc.</holder>
    </copyright>
    <publisher>
      <publishername>
	Addison Wesley Longman
      </publishername>
    </publisher>
  </biblioentry>

</bibliography>

</section>