<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>glibmm 2.4: Glib::IConv Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff"> <table border="0" width="100%"> <tr> <td width="10%" height="40"><img src="../../images/gtkmm_logo.gif" alt="logo" border="0" width="100%" height="100%"/></td> <td width="90%" height="40"><img src="../../images/top.gif" alt="top" width="100%" height="40"/></td> </tr> </table> <center> <a class="qindex" href="../../../../gtkmm-2.4/docs/index.html">Main Page</a> <a href="../../../../gtkmm-2.4/docs/reference/html/group__Widgets.html">Widgets</a> <a class="qindex" href="namespaces.html">glibmm Namespaces</a> <a href="../../../../gtkmm-2.4/docs/tutorial/html/index.html"> Book</a> </center> <hr width="100%"/> <!-- begin main content --> <div id="content"> <!-- Generated by Doxygen 1.5.3 --> <div class="nav"> <a class="el" href="namespaceGlib.html">Glib</a>::<a class="el" href="classGlib_1_1IConv.html">IConv</a></div> <h1>Glib::IConv Class Reference<br> <small> [<a class="el" href="group__CharsetConv.html">Character Set Conversion</a>]</small> </h1><!-- doxytag: class="Glib::IConv" -->Thin iconv() wrapper. <a href="#_details">More...</a> <p> <p> <a href="classGlib_1_1IConv-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#bb841f9db0731eb8cbc4ea2a8a5d23d5">IConv</a> (const <a class="elRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/classstd_1_1basic__string.html">std::string</a>& to_codeset, const <a class="elRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/classstd_1_1basic__string.html">std::string</a>& from_codeset)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Open new conversion descriptor. <a href="#bb841f9db0731eb8cbc4ea2a8a5d23d5"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#d2722879e0465fec5d9f2c126a602557">IConv</a> (GIConv gobject)</td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#b56fc0ef68a7f7fee554728a16c6cba0">~IConv</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Close conversion descriptor. <a href="#b56fc0ef68a7f7fee554728a16c6cba0"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classstatic_01const_01std_1_1size__t.html">size_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#15b01bcbafa643bb7c748bfe0048cb82">iconv</a> (char** inbuf, gsize* inbytes_left, char** outbuf, gsize* outbytes_left)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Same as the standard UNIX routine iconv(), but may be implemented via libiconv on UNIX flavors that lack a native implementation. <a href="#15b01bcbafa643bb7c748bfe0048cb82"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#b0655474f54dd933d3f6959bdafffabe">reset</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Reset conversion descriptor to initial state. <a href="#b0655474f54dd933d3f6959bdafffabe"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/classstd_1_1basic__string.html">std::string</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#82af42360f040532ebd4b215dc89a59d">convert</a> (const <a class="elRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/classstd_1_1basic__string.html">std::string</a>& str)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Convert from one encoding to another. <a href="#82af42360f040532ebd4b215dc89a59d"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">GIConv </td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#12a8c09489388d1efcf9b70586307614">gobj</a> ()</td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Thin iconv() wrapper. <p> glibmm provides <a class="el" href="group__CharsetConv.html#g58f7e4556c436a96c64b186bbc8f7f4c" title="Convert from one encoding to another.">Glib::convert()</a> and <a class="el" href="group__CharsetConv.html#g4517b17f2aad4cd5c0e0640de212d928" title="Convert from the current locale's encoding to UTF-8.">Glib::locale_to_utf8()</a> which are likely more convenient than the raw iconv wrappers. However, creating an <a class="el" href="classGlib_1_1IConv.html" title="Thin iconv() wrapper.">IConv</a> object once and using the <a class="el" href="classGlib_1_1IConv.html#82af42360f040532ebd4b215dc89a59d" title="Convert from one encoding to another.">convert()</a> method could be useful when converting multiple times between the same charsets. <hr><h2>Constructor& Destructor Documentation</h2> <a class="anchor" name="bb841f9db0731eb8cbc4ea2a8a5d23d5"></a><!-- doxytag: member="Glib::IConv::IConv" ref="bb841f9db0731eb8cbc4ea2a8a5d23d5" args="(const std::string &to_codeset, const std::string &from_codeset)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Glib::IConv::IConv </td> <td>(</td> <td class="paramtype">const <a class="elRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/classstd_1_1basic__string.html">std::string</a> & </td> <td class="paramname"> <em>to_codeset</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="elRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/classstd_1_1basic__string.html">std::string</a> & </td> <td class="paramname"> <em>from_codeset</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Open new conversion descriptor. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>to_codeset</em> </td><td>Destination codeset. </td></tr> <tr><td valign="top"></td><td valign="top"><em>from_codeset</em> </td><td>Source codeset. </td></tr> </table> </dl> <dl compact><dt><b>Exceptions:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classGlib_1_1ConvertError.html" title="Exception class for charset conversion errors.">Glib::ConvertError</a></em> </td><td></td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="d2722879e0465fec5d9f2c126a602557"></a><!-- doxytag: member="Glib::IConv::IConv" ref="d2722879e0465fec5d9f2c126a602557" args="(GIConv gobject)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Glib::IConv::IConv </td> <td>(</td> <td class="paramtype">GIConv </td> <td class="paramname"> <em>gobject</em> </td> <td> ) </td> <td width="100%"><code> [explicit]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <a class="anchor" name="b56fc0ef68a7f7fee554728a16c6cba0"></a><!-- doxytag: member="Glib::IConv::~IConv" ref="b56fc0ef68a7f7fee554728a16c6cba0" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">Glib::IConv::~IConv </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Close conversion descriptor. <p> </div> </div><p> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="15b01bcbafa643bb7c748bfe0048cb82"></a><!-- doxytag: member="Glib::IConv::iconv" ref="15b01bcbafa643bb7c748bfe0048cb82" args="(char **inbuf, gsize *inbytes_left, char **outbuf, gsize *outbytes_left)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classstatic_01const_01std_1_1size__t.html">size_t</a> Glib::IConv::iconv </td> <td>(</td> <td class="paramtype">char ** </td> <td class="paramname"> <em>inbuf</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">gsize * </td> <td class="paramname"> <em>inbytes_left</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char ** </td> <td class="paramname"> <em>outbuf</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">gsize * </td> <td class="paramname"> <em>outbytes_left</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Same as the standard UNIX routine iconv(), but may be implemented via libiconv on UNIX flavors that lack a native implementation. <p> glibmm provides <a class="el" href="group__CharsetConv.html#g58f7e4556c436a96c64b186bbc8f7f4c" title="Convert from one encoding to another.">Glib::convert()</a> and <a class="el" href="group__CharsetConv.html#g4517b17f2aad4cd5c0e0640de212d928" title="Convert from the current locale's encoding to UTF-8.">Glib::locale_to_utf8()</a> which are likely more convenient than the raw iconv wrappers. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>inbuf</em> </td><td>Bytes to convert. </td></tr> <tr><td valign="top"></td><td valign="top"><em>inbytes_left</em> </td><td>In/out parameter, bytes remaining to convert in <em>inbuf</em>. </td></tr> <tr><td valign="top"></td><td valign="top"><em>outbuf</em> </td><td>Converted output bytes. </td></tr> <tr><td valign="top"></td><td valign="top"><em>outbytes_left</em> </td><td>In/out parameter, bytes available to fill in <em>outbuf</em>. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>Count of non-reversible conversions, or <code>static_cast<size_t>(-1)</code> on error. </dd></dl> </div> </div><p> <a class="anchor" name="b0655474f54dd933d3f6959bdafffabe"></a><!-- doxytag: member="Glib::IConv::reset" ref="b0655474f54dd933d3f6959bdafffabe" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Glib::IConv::reset </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Reset conversion descriptor to initial state. <p> Same as <code>iconv(0, 0, 0, 0)</code>, but implemented slightly differently in order to work on Sun Solaris <= 7. It's also more obvious so you're encouraged to use it. </div> </div><p> <a class="anchor" name="82af42360f040532ebd4b215dc89a59d"></a><!-- doxytag: member="Glib::IConv::convert" ref="82af42360f040532ebd4b215dc89a59d" args="(const std::string &str)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="elRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/classstd_1_1basic__string.html">std::string</a> Glib::IConv::convert </td> <td>(</td> <td class="paramtype">const <a class="elRef" doxygen="libstdc++.tag.xml:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/classstd_1_1basic__string.html">std::string</a> & </td> <td class="paramname"> <em>str</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table> </div> <div class="memdoc"> <p> Convert from one encoding to another. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>str</em> </td><td>The string to convert. </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>The converted string. </dd></dl> <dl compact><dt><b>Exceptions:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classGlib_1_1ConvertError.html" title="Exception class for charset conversion errors.">Glib::ConvertError</a></em> </td><td></td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="12a8c09489388d1efcf9b70586307614"></a><!-- doxytag: member="Glib::IConv::gobj" ref="12a8c09489388d1efcf9b70586307614" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">GIConv Glib::IConv::gobj </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p> </div> </div><p> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="convert_8h.html">convert.h</a></ul> </div> <!-- end main content --> <hr><address><small> Generated for glibmm 2.4 by <a href="http://www.doxygen.org/index.html"> Doxygen</a> 1.5.3 © 1997-2001</small></address> </body> </html>