File: classGlib_1_1IConv.html

package info (click to toggle)
glibmm2.4 2.42.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 53,308 kB
  • ctags: 14,868
  • sloc: xml: 108,462; cpp: 15,282; sh: 11,421; perl: 5,139; python: 1,626; makefile: 304
file content (306 lines) | stat: -rw-r--r-- 17,137 bytes parent folder | download
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>glibmm: Glib::IConv Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">glibmm
   &#160;<span id="projectnumber">2.42.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.7 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceGlib.html">Glib</a></li><li class="navelem"><a class="el" href="classGlib_1_1IConv.html">IConv</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classGlib_1_1IConv-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Glib::IConv Class Reference<div class="ingroups"><a class="el" href="group__CharsetConv.html">Character Set Conversion</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Thin iconv() wrapper.  
 <a href="classGlib_1_1IConv.html#details">More...</a></p>

<p><code>#include &lt;glibmm/convert.h&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:abb841f9db0731eb8cbc4ea2a8a5d23d5"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#abb841f9db0731eb8cbc4ea2a8a5d23d5">IConv</a> (const <a class="elRef" doxygen="/opt/gnome/share/mm-common/doctags/libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01681.html#ga32db3d9898c44d3b3a578b560f7758cc">std::string</a>&amp; to_codeset, const <a class="elRef" doxygen="/opt/gnome/share/mm-common/doctags/libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01681.html#ga32db3d9898c44d3b3a578b560f7758cc">std::string</a>&amp; from_codeset)</td></tr>
<tr class="memdesc:abb841f9db0731eb8cbc4ea2a8a5d23d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Open new conversion descriptor.  <a href="#abb841f9db0731eb8cbc4ea2a8a5d23d5">More...</a><br /></td></tr>
<tr class="separator:abb841f9db0731eb8cbc4ea2a8a5d23d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2722879e0465fec5d9f2c126a602557"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#ad2722879e0465fec5d9f2c126a602557">IConv</a> (GIConv gobject)</td></tr>
<tr class="separator:ad2722879e0465fec5d9f2c126a602557"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab56fc0ef68a7f7fee554728a16c6cba0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#ab56fc0ef68a7f7fee554728a16c6cba0">~IConv</a> ()</td></tr>
<tr class="memdesc:ab56fc0ef68a7f7fee554728a16c6cba0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close conversion descriptor.  <a href="#ab56fc0ef68a7f7fee554728a16c6cba0">More...</a><br /></td></tr>
<tr class="separator:ab56fc0ef68a7f7fee554728a16c6cba0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a094ab3c0fe74ae49968fb7ddfc9372fc"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#a094ab3c0fe74ae49968fb7ddfc9372fc">iconv</a> (char** inbuf, gsize* inbytes_left, char** outbuf, gsize* outbytes_left)</td></tr>
<tr class="memdesc:a094ab3c0fe74ae49968fb7ddfc9372fc"><td class="mdescLeft">&#160;</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="#a094ab3c0fe74ae49968fb7ddfc9372fc">More...</a><br /></td></tr>
<tr class="separator:a094ab3c0fe74ae49968fb7ddfc9372fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0655474f54dd933d3f6959bdafffabe"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#ab0655474f54dd933d3f6959bdafffabe">reset</a> ()</td></tr>
<tr class="memdesc:ab0655474f54dd933d3f6959bdafffabe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset conversion descriptor to initial state.  <a href="#ab0655474f54dd933d3f6959bdafffabe">More...</a><br /></td></tr>
<tr class="separator:ab0655474f54dd933d3f6959bdafffabe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a82af42360f040532ebd4b215dc89a59d"><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="/opt/gnome/share/mm-common/doctags/libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01681.html#ga32db3d9898c44d3b3a578b560f7758cc">std::string</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#a82af42360f040532ebd4b215dc89a59d">convert</a> (const <a class="elRef" doxygen="/opt/gnome/share/mm-common/doctags/libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01681.html#ga32db3d9898c44d3b3a578b560f7758cc">std::string</a>&amp; str)</td></tr>
<tr class="memdesc:a82af42360f040532ebd4b215dc89a59d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert from one encoding to another.  <a href="#a82af42360f040532ebd4b215dc89a59d">More...</a><br /></td></tr>
<tr class="separator:a82af42360f040532ebd4b215dc89a59d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12a8c09489388d1efcf9b70586307614"><td class="memItemLeft" align="right" valign="top">GIConv&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGlib_1_1IConv.html#a12a8c09489388d1efcf9b70586307614">gobj</a> ()</td></tr>
<tr class="separator:a12a8c09489388d1efcf9b70586307614"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Thin iconv() wrapper. </p>
<p>glibmm provides <a class="el" href="group__CharsetConv.html#ga58f7e4556c436a96c64b186bbc8f7f4c" title="Convert from one encoding to another. ">Glib::convert()</a> and <a class="el" href="group__CharsetConv.html#ga4517b17f2aad4cd5c0e0640de212d928" title="Convert from the current locale&#39;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#a82af42360f040532ebd4b215dc89a59d" title="Convert from one encoding to another. ">convert()</a> method could be useful when converting multiple times between the same charsets. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="abb841f9db0731eb8cbc4ea2a8a5d23d5"></a>
<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="/opt/gnome/share/mm-common/doctags/libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01681.html#ga32db3d9898c44d3b3a578b560f7758cc">std::string</a> &amp;&#160;</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="/opt/gnome/share/mm-common/doctags/libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01681.html#ga32db3d9898c44d3b3a578b560f7758cc">std::string</a> &amp;&#160;</td>
          <td class="paramname"><em>from_codeset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Open new conversion descriptor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">to_codeset</td><td>Destination codeset. </td></tr>
    <tr><td class="paramname">from_codeset</td><td>Source codeset. </td></tr>
  </table>
  </dd>
</dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classGlib_1_1ConvertError.html" title="Exception class for charset conversion errors. ">Glib::ConvertError</a></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad2722879e0465fec5d9f2c126a602557"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">Glib::IConv::IConv </td>
          <td>(</td>
          <td class="paramtype">GIConv&#160;</td>
          <td class="paramname"><em>gobject</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="ab56fc0ef68a7f7fee554728a16c6cba0"></a>
<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></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close conversion descriptor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a82af42360f040532ebd4b215dc89a59d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="/opt/gnome/share/mm-common/doctags/libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01681.html#ga32db3d9898c44d3b3a578b560f7758cc">std::string</a> Glib::IConv::convert </td>
          <td>(</td>
          <td class="paramtype">const <a class="elRef" doxygen="/opt/gnome/share/mm-common/doctags/libstdc++.tag:http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01681.html#ga32db3d9898c44d3b3a578b560f7758cc">std::string</a> &amp;&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Convert from one encoding to another. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The string to convert. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The converted string. </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classGlib_1_1ConvertError.html" title="Exception class for charset conversion errors. ">Glib::ConvertError</a></td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a12a8c09489388d1efcf9b70586307614"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">GIConv Glib::IConv::gobj </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a094ab3c0fe74ae49968fb7ddfc9372fc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t Glib::IConv::iconv </td>
          <td>(</td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>inbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">gsize *&#160;</td>
          <td class="paramname"><em>inbytes_left</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>outbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">gsize *&#160;</td>
          <td class="paramname"><em>outbytes_left</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></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>
<p>glibmm provides <a class="el" href="group__CharsetConv.html#ga58f7e4556c436a96c64b186bbc8f7f4c" title="Convert from one encoding to another. ">Glib::convert()</a> and <a class="el" href="group__CharsetConv.html#ga4517b17f2aad4cd5c0e0640de212d928" title="Convert from the current locale&#39;s encoding to UTF-8. ">Glib::locale_to_utf8()</a> which are likely more convenient than the raw iconv wrappers. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">inbuf</td><td><a class="el" href="classGlib_1_1Bytes.html" title="A simple refcounted data type representing an immutable byte sequence from an unspecified origin...">Bytes</a> to convert. </td></tr>
    <tr><td class="paramname">inbytes_left</td><td>In/out parameter, bytes remaining to convert in <em>inbuf</em>. </td></tr>
    <tr><td class="paramname">outbuf</td><td>Converted output bytes. </td></tr>
    <tr><td class="paramname">outbytes_left</td><td>In/out parameter, bytes available to fill in <em>outbuf</em>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Count of non-reversible conversions, or <code>static_cast&lt;std::size_t&gt;(-1)</code> on error. </dd></dl>

</div>
</div>
<a class="anchor" id="ab0655474f54dd933d3f6959bdafffabe"></a>
<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></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reset conversion descriptor to initial state. </p>
<p>Same as <code>iconv(0, 0, 0, 0)</code>, but implemented slightly differently in order to work on Sun Solaris &lt;= 7. It's also more obvious so you're encouraged to use it. </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Sep 22 2014 21:38:33 for glibmm by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.7
</small></address>
</body>
</html>