blob: a1c580f94ad65890d6ccb8f41a0d31fcf7152d7b [file] [log] [blame]
<section xmlns="http://docbook.org/ns/docbook" version="5.0"
xml:id="std.localization.facet.ctype" xreflabel="ctype">
<?dbhtml filename="ctype.html"?>
<info><title>ctype</title>
<keywordset>
<keyword>ISO C++</keyword>
<keyword>ctype</keyword>
</keywordset>
</info>
<section xml:id="facet.ctype.impl"><info><title>Implementation</title></info>
<section xml:id="facet.ctype.impl.spec"><info><title>Specializations</title></info>
<para>
For the required specialization <classname>codecvt&lt;wchar_t, char, mbstate_t&gt;</classname>,
conversions are made between the internal character set (always UCS4
on GNU/Linux) and whatever the currently selected locale for the
<code>LC_CTYPE</code> 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 <function>mcsrtombs</function> for the
conversions between <type>char</type> to <type>wchar_t</type> and
<function>wcsrtombs</function> for conversions between <type>wchar_t</type>
and <type>char</type>.
</para>
<para>
Neither of these two required specializations deals with Unicode
characters.
</para>
</section>
</section>
<section xml:id="facet.ctype.future"><info><title>Future</title></info>
<itemizedlist>
<listitem>
<para>
How to deal with the global locale issue?
</para></listitem>
<listitem>
<para>
How to deal with types other than <type>char</type>, <type>wchar_t</type>?
</para></listitem>
<listitem><para>
Overlap between codecvt/ctype: narrow/widen
</para></listitem>
<listitem>
<para>
<type>mask</type> typedef in <classname>codecvt_base</classname>,
argument types in <type>codecvt</type>. 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 <type>ctype&lt;wchar_t&gt;::mask</type> stuff under control.
Need to make some kind of static table, and not do lookup every time
somebody hits the <code>do_is...</code> functions. Too bad we can't
just redefine <type>mask</type> for
<classname>ctype&lt;wchar_t&gt;</classname>
</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 xml:id="facet.ctype.biblio"><info><title>Bibliography</title></info>
<biblioentry>
<citetitle>
The GNU C Library
</citetitle>
<author><personname><surname>McGrath</surname><firstname>Roland</firstname></personname></author>
<author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
<copyright>
<year>2007</year>
<holder>FSF</holder>
</copyright>
<pagenums>Chapters 6 Character Set Handling and 7 Locales and Internationalization</pagenums>
</biblioentry>
<biblioentry>
<citetitle>
Correspondence
</citetitle>
<author><personname><surname>Drepper</surname><firstname>Ulrich</firstname></personname></author>
<copyright>
<year>2002</year>
<holder/>
</copyright>
</biblioentry>
<biblioentry>
<citetitle>
ISO/IEC 14882:1998 Programming languages - C++
</citetitle>
<copyright>
<year>1998</year>
<holder>ISO</holder>
</copyright>
</biblioentry>
<biblioentry>
<citetitle>
ISO/IEC 9899:1999 Programming languages - C
</citetitle>
<copyright>
<year>1999</year>
<holder>ISO</holder>
</copyright>
</biblioentry>
<biblioentry>
<title>
<link xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="https://www.unix.org/version3/ieee_std.html">
The Open Group Base Specifications, Issue 6 (IEEE Std. 1003.1-2004)
</link>
</title>
<copyright>
<year>1999</year>
<holder>
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.</holder>
</copyright>
</biblioentry>
<biblioentry>
<citetitle>
The C++ Programming Language, Special Edition
</citetitle>
<author><personname><surname>Stroustrup</surname><firstname>Bjarne</firstname></personname></author>
<copyright>
<year>2000</year>
<holder>Addison Wesley, Inc.</holder>
</copyright>
<pagenums>Appendix D</pagenums>
<publisher>
<publishername>
Addison Wesley
</publishername>
</publisher>
</biblioentry>
<biblioentry>
<citetitle>
Standard C++ IOStreams and Locales
</citetitle>
<subtitle>
Advanced Programmer's Guide and Reference
</subtitle>
<author><personname><surname>Langer</surname><firstname>Angelika</firstname></personname></author>
<author><personname><surname>Kreft</surname><firstname>Klaus</firstname></personname></author>
<copyright>
<year>2000</year>
<holder>Addison Wesley Longman, Inc.</holder>
</copyright>
<publisher>
<publishername>
Addison Wesley Longman
</publishername>
</publisher>
</biblioentry>
</bibliography>
</section>