1<section xmlns="http://docbook.org/ns/docbook" version="5.0" 2 xml:id="std.localization.facet.ctype" xreflabel="ctype"> 3<?dbhtml filename="ctype.html"?> 4 5<info><title>ctype</title> 6 <keywordset> 7 <keyword>ISO C++</keyword> 8 <keyword>ctype</keyword> 9 </keywordset> 10</info> 11 12 13 14<section xml:id="facet.ctype.impl"><info><title>Implementation</title></info> 15 16 17 <section xml:id="facet.ctype.impl.spec"><info><title>Specializations</title></info> 18 19 20<para> 21For the required specialization <classname>codecvt<wchar_t, char, mbstate_t></classname>, 22conversions are made between the internal character set (always UCS4 23on GNU/Linux) and whatever the currently selected locale for the 24<code>LC_CTYPE</code> category implements. 25</para> 26 27<para> 28The two required specializations are implemented as follows: 29</para> 30 31<para> 32<code> 33ctype<char> 34</code> 35</para> 36<para> 37This is simple specialization. Implementing this was a piece of cake. 38</para> 39 40<para> 41<code> 42ctype<wchar_t> 43</code> 44</para> 45<para> 46This specialization, by specifying all the template parameters, pretty 47much ties the hands of implementors. As such, the implementation is 48straightforward, involving <function>mcsrtombs</function> for the 49conversions between <type>char</type> to <type>wchar_t</type> and 50<function>wcsrtombs</function> for conversions between <type>wchar_t</type> 51and <type>char</type>. 52</para> 53 54<para> 55Neither of these two required specializations deals with Unicode 56characters. 57</para> 58 59 </section> 60</section> 61 62<section xml:id="facet.ctype.future"><info><title>Future</title></info> 63 64 65 66<itemizedlist> 67 <listitem> 68 <para> 69 How to deal with the global locale issue? 70 </para></listitem> 71 72 <listitem> 73 <para> 74 How to deal with types other than <type>char</type>, <type>wchar_t</type>? 75 </para></listitem> 76 77 <listitem><para> 78 Overlap between codecvt/ctype: narrow/widen 79 </para></listitem> 80 81 <listitem> 82 <para> 83 <type>mask</type> typedef in <classname>codecvt_base</classname>, 84 argument types in <type>codecvt</type>. what is know about this type? 85 </para></listitem> 86 87 <listitem> 88 <para> 89 Why mask* argument in codecvt? 90 </para></listitem> 91 92 <listitem> 93 <para> 94 Can this be made (more) generic? is there a simple way to 95 straighten out the configure-time mess that is a by-product of 96 this class? 97 </para></listitem> 98 99 <listitem> 100 <para> 101 Get the <type>ctype<wchar_t>::mask</type> stuff under control. 102 Need to make some kind of static table, and not do lookup every time 103 somebody hits the <code>do_is...</code> functions. Too bad we can't 104 just redefine <type>mask</type> for 105 <classname>ctype<wchar_t></classname> 106 </para></listitem> 107 108 <listitem> 109 <para> 110 Rename abstract base class. See if just smash-overriding is a 111 better approach. Clarify, add sanity to naming. 112 </para> 113 </listitem> 114 115</itemizedlist> 116 117 118</section> 119 120 121<bibliography xml:id="facet.ctype.biblio"><info><title>Bibliography</title></info> 122 123 124 <biblioentry> 125 <citetitle> 126 The GNU C Library 127 </citetitle> 128 <author><personname><surname>McGrath</surname><firstname>Roland</firstname></personname></author> 129 <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author> 130 <copyright> 131 <year>2007</year> 132 <holder>FSF</holder> 133 </copyright> 134 <pagenums>Chapters 6 Character Set Handling and 7 Locales and Internationalization</pagenums> 135 </biblioentry> 136 137 <biblioentry> 138 <citetitle> 139 Correspondence 140 </citetitle> 141 <author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author> 142 <copyright> 143 <year>2002</year> 144 <holder/> 145 </copyright> 146 </biblioentry> 147 148 <biblioentry> 149 <citetitle> 150 ISO/IEC 14882:1998 Programming languages - C++ 151 </citetitle> 152 <copyright> 153 <year>1998</year> 154 <holder>ISO</holder> 155 </copyright> 156 </biblioentry> 157 158 <biblioentry> 159 <citetitle> 160 ISO/IEC 9899:1999 Programming languages - C 161 </citetitle> 162 <copyright> 163 <year>1999</year> 164 <holder>ISO</holder> 165 </copyright> 166 </biblioentry> 167 168 <biblioentry> 169 <title> 170 <link xmlns:xlink="http://www.w3.org/1999/xlink" 171 xlink:href="http://www.unix.org/version3/ieee_std.html"> 172 The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004) 173 </link> 174 </title> 175 176 <copyright> 177 <year>1999</year> 178 <holder> 179 The Open Group/The Institute of Electrical and Electronics Engineers, Inc.</holder> 180 </copyright> 181 </biblioentry> 182 183 <biblioentry> 184 <citetitle> 185 The C++ Programming Language, Special Edition 186 </citetitle> 187 <author><personname><surname>Stroustrup</surname><firstname>Bjarne</firstname></personname></author> 188 <copyright> 189 <year>2000</year> 190 <holder>Addison Wesley, Inc.</holder> 191 </copyright> 192 <pagenums>Appendix D</pagenums> 193 <publisher> 194 <publishername> 195 Addison Wesley 196 </publishername> 197 </publisher> 198 </biblioentry> 199 200 <biblioentry> 201 <citetitle> 202 Standard C++ IOStreams and Locales 203 </citetitle> 204 <subtitle> 205 Advanced Programmer's Guide and Reference 206 </subtitle> 207 <author><personname><surname>Langer</surname><firstname>Angelika</firstname></personname></author> 208 <author><personname><surname>Kreft</surname><firstname>Klaus</firstname></personname></author> 209 <copyright> 210 <year>2000</year> 211 <holder>Addison Wesley Longman, Inc.</holder> 212 </copyright> 213 <publisher> 214 <publishername> 215 Addison Wesley Longman 216 </publishername> 217 </publisher> 218 </biblioentry> 219 220</bibliography> 221 222</section> 223