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 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753
|
<!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"/>
<title>wxWidgets: wxMBConv 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" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
<tbody>
<tr>
<td id="projectlogo">
<a href="http://www.wxwidgets.org/" target="_new">
<img alt="wxWidgets" src="logo.png"/>
</a>
</td>
<td style="padding-left: 0.5em; text-align: right;">
<span id="projectnumber">Version: 3.0.2</span>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Categories</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="classwx_m_b_conv-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">wxMBConv Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group__group__class__conv.html">Text Conversion</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <wx/strconv.h></code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for wxMBConv:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classwx_m_b_conv__inherit__graph.png" border="0" usemap="#wx_m_b_conv_inherit__map" alt="Inheritance graph"/></div>
<map name="wx_m_b_conv_inherit__map" id="wx_m_b_conv_inherit__map">
<area shape="rect" id="node3" href="classwx_conv_auto.html" title="This class implements a Unicode to/from multibyte converter capable of automatically recognizing the ..." alt="" coords="5,83,99,111"/><area shape="rect" id="node5" href="classwx_c_s_conv.html" title="This class converts between any character set supported by the system and Unicode." alt="" coords="123,83,205,111"/><area shape="rect" id="node7" href="classwx_m_b_conv_u_t_f16.html" title="This class is used to convert between multibyte encodings and UTF-16 Unicode encoding (also known as ..." alt="" coords="229,83,355,111"/><area shape="rect" id="node9" href="classwx_m_b_conv_u_t_f32.html" title="This class is used to convert between multibyte encodings and UTF-32 Unicode encoding (also known as ..." alt="" coords="379,83,504,111"/><area shape="rect" id="node11" href="classwx_m_b_conv_u_t_f7.html" title="This class converts between the UTF-7 encoding and Unicode." alt="" coords="528,83,645,111"/><area shape="rect" id="node13" href="classwx_m_b_conv_u_t_f8.html" title="This class converts between the UTF-8 encoding and Unicode." alt="" coords="669,83,787,111"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class is the base class of a hierarchy of classes capable of converting text strings between multibyte (SBCS or DBCS) encodings and Unicode. </p>
<p>This is an abstract base class which defines the operations implemented by all different conversion classes. The derived classes don't add any new operations of their own (except, possibly, some non-default constructors) and so you should simply use this class <a class="el" href="classwx_m_b_conv.html#a22ad1976c06a540a95dfa878038d65f2" title="Convert multibyte string to a wide character one.">ToWChar()</a> and <a class="el" href="classwx_m_b_conv.html#a149c15b515e008fdd1f69a852f11594e" title="Converts wide character string to multibyte.">FromWChar()</a> (or <a class="el" href="classwx_m_b_conv.html#a0e572efeda6c5c73ddff1292609fa211" title="Converts from multibyte encoding to Unicode by calling ToWChar() and allocating a temporary wxWCharBu...">cMB2WC()</a> and <a class="el" href="classwx_m_b_conv.html#a496c808fc769800659e5de1a74115a54" title="Converts from Unicode to multibyte encoding by calling FromWChar() and allocating a temporary wxCharB...">cWC2MB()</a>) methods with the objects of the derived class.</p>
<p>In the documentation for this and related classes please notice that length of the string refers to the number of characters in the string not counting the terminating <code>NUL</code>, if any. While the size of the string is the total number of bytes in the string, including any trailing <code>NUL</code>. Thus, length of wide character string <code>L"foo"</code> is 3 while its size can be either 8 or 16 depending on whether <code>wchar_t</code> is 2 bytes (as under Windows) or 4 (Unix).</p>
<h2></h2>
<div><span class="lib">Library:</span>  <span class="lib_text"><a class="el" href="page_libs.html#page_libs_wxbase">wxBase</a></span></div><div><span class="category">Category:</span>  <span class="category_text"><a class="el" href="group__group__class__conv.html">Text Conversion</a></span></div><dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_c_s_conv.html" title="This class converts between any character set supported by the system and Unicode.">wxCSConv</a>, <a class="el" href="classwx_encoding_converter.html" title="This class is capable of converting strings between two 8-bit encodings/charsets.">wxEncodingConverter</a>, <a class="el" href="overview_mbconv.html">wxMBConv Overview</a> </dd></dl>
</div><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:ab2348d20301679ce0cf5c565446b0080"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#ab2348d20301679ce0cf5c565446b0080">wxMBConv</a> ()</td></tr>
<tr class="memdesc:ab2348d20301679ce0cf5c565446b0080"><td class="mdescLeft"> </td><td class="mdescRight">Trivial default constructor. <a href="#ab2348d20301679ce0cf5c565446b0080"></a><br/></td></tr>
<tr class="separator:ab2348d20301679ce0cf5c565446b0080"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae6fd1020a2c7c82191c4822682e80d05"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classwx_m_b_conv.html">wxMBConv</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#ae6fd1020a2c7c82191c4822682e80d05">Clone</a> () const =0</td></tr>
<tr class="memdesc:ae6fd1020a2c7c82191c4822682e80d05"><td class="mdescLeft"> </td><td class="mdescRight">This pure virtual function is overridden in each of the derived classes to return a new copy of the object it is called on. <a href="#ae6fd1020a2c7c82191c4822682e80d05"></a><br/></td></tr>
<tr class="separator:ae6fd1020a2c7c82191c4822682e80d05"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a2d6590cbcc686be76a9c4f1c071ff99f"><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a2d6590cbcc686be76a9c4f1c071ff99f">GetMBNulLen</a> () const </td></tr>
<tr class="memdesc:a2d6590cbcc686be76a9c4f1c071ff99f"><td class="mdescLeft"> </td><td class="mdescRight">This function returns 1 for most of the multibyte encodings in which the string is terminated by a single <code>NUL</code>, 2 for UTF-16 and 4 for UTF-32 for which the string is terminated with 2 and 4 <code>NUL</code> characters respectively. <a href="#a2d6590cbcc686be76a9c4f1c071ff99f"></a><br/></td></tr>
<tr class="separator:a2d6590cbcc686be76a9c4f1c071ff99f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a22ad1976c06a540a95dfa878038d65f2"><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a22ad1976c06a540a95dfa878038d65f2">ToWChar</a> (wchar_t *dst, size_t dstLen, const char *src, size_t srcLen=wxNO_LEN) const </td></tr>
<tr class="memdesc:a22ad1976c06a540a95dfa878038d65f2"><td class="mdescLeft"> </td><td class="mdescRight">Convert multibyte string to a wide character one. <a href="#a22ad1976c06a540a95dfa878038d65f2"></a><br/></td></tr>
<tr class="separator:a22ad1976c06a540a95dfa878038d65f2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a149c15b515e008fdd1f69a852f11594e"><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a149c15b515e008fdd1f69a852f11594e">FromWChar</a> (char *dst, size_t dstLen, const wchar_t *src, size_t srcLen=wxNO_LEN) const </td></tr>
<tr class="memdesc:a149c15b515e008fdd1f69a852f11594e"><td class="mdescLeft"> </td><td class="mdescRight">Converts wide character string to multibyte. <a href="#a149c15b515e008fdd1f69a852f11594e"></a><br/></td></tr>
<tr class="separator:a149c15b515e008fdd1f69a852f11594e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0e572efeda6c5c73ddff1292609fa211"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_w_char_buffer.html">wxWCharBuffer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a0e572efeda6c5c73ddff1292609fa211">cMB2WC</a> (const char *in, size_t inLen, size_t *outLen) const </td></tr>
<tr class="memdesc:a0e572efeda6c5c73ddff1292609fa211"><td class="mdescLeft"> </td><td class="mdescRight">Converts from multibyte encoding to Unicode by calling <a class="el" href="classwx_m_b_conv.html#a22ad1976c06a540a95dfa878038d65f2" title="Convert multibyte string to a wide character one.">ToWChar()</a> and allocating a temporary <a class="el" href="classwx_w_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for wchar_t type.">wxWCharBuffer</a> to hold the result. <a href="#a0e572efeda6c5c73ddff1292609fa211"></a><br/></td></tr>
<tr class="separator:a0e572efeda6c5c73ddff1292609fa211"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:aced3961b0bdad13f390343b2b70d49b1"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_w_char_buffer.html">wxWCharBuffer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#aced3961b0bdad13f390343b2b70d49b1">cMB2WC</a> (const <a class="el" href="classwx_char_buffer.html">wxCharBuffer</a> &buf) const </td></tr>
<tr class="memdesc:aced3961b0bdad13f390343b2b70d49b1"><td class="mdescLeft"> </td><td class="mdescRight">Converts a char buffer to wide char one. <a href="#aced3961b0bdad13f390343b2b70d49b1"></a><br/></td></tr>
<tr class="separator:aced3961b0bdad13f390343b2b70d49b1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a496c808fc769800659e5de1a74115a54"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_char_buffer.html">wxCharBuffer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a496c808fc769800659e5de1a74115a54">cWC2MB</a> (const wchar_t *in, size_t inLen, size_t *outLen) const </td></tr>
<tr class="memdesc:a496c808fc769800659e5de1a74115a54"><td class="mdescLeft"> </td><td class="mdescRight">Converts from Unicode to multibyte encoding by calling <a class="el" href="classwx_m_b_conv.html#a149c15b515e008fdd1f69a852f11594e" title="Converts wide character string to multibyte.">FromWChar()</a> and allocating a temporary <a class="el" href="classwx_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for char type.">wxCharBuffer</a> to hold the result. <a href="#a496c808fc769800659e5de1a74115a54"></a><br/></td></tr>
<tr class="separator:a496c808fc769800659e5de1a74115a54"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a34d1ea0725e5001e4f74a5dbf5c81c4f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_char_buffer.html">wxCharBuffer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a34d1ea0725e5001e4f74a5dbf5c81c4f">cWC2MB</a> (const <a class="el" href="classwx_w_char_buffer.html">wxWCharBuffer</a> &buf) const </td></tr>
<tr class="memdesc:a34d1ea0725e5001e4f74a5dbf5c81c4f"><td class="mdescLeft"> </td><td class="mdescRight">Converts a wide char buffer to char one. <a href="#a34d1ea0725e5001e4f74a5dbf5c81c4f"></a><br/></td></tr>
<tr class="separator:a34d1ea0725e5001e4f74a5dbf5c81c4f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a79d63eff51836148157c986943835742"><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a79d63eff51836148157c986943835742">MB2WC</a> (wchar_t *out, const char *in, size_t outLen) const </td></tr>
<tr class="separator:a79d63eff51836148157c986943835742"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a537a0f90ab4738e3e9be58d9a77b71b1"><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a537a0f90ab4738e3e9be58d9a77b71b1">WC2MB</a> (char *buf, const wchar_t *psz, size_t n) const </td></tr>
<tr class="separator:a537a0f90ab4738e3e9be58d9a77b71b1"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:a62b723fea6758812e786a3ec5797f8ba"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a62b723fea6758812e786a3ec5797f8ba">cMB2WX</a> (const char *psz) const </td></tr>
<tr class="memdesc:a62b723fea6758812e786a3ec5797f8ba"><td class="mdescLeft"> </td><td class="mdescRight">Converts from multibyte encoding to the current wxChar type (which depends on whether wxUSE_UNICODE is set to 1). <a href="#a62b723fea6758812e786a3ec5797f8ba"></a><br/></td></tr>
<tr class="separator:a62b723fea6758812e786a3ec5797f8ba"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af8632260d14b0afcba0f2bc524ca2134"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_w_char_buffer.html">wxWCharBuffer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#af8632260d14b0afcba0f2bc524ca2134">cMB2WX</a> (const char *psz) const </td></tr>
<tr class="memdesc:af8632260d14b0afcba0f2bc524ca2134"><td class="mdescLeft"> </td><td class="mdescRight">Converts from multibyte encoding to the current wxChar type (which depends on whether wxUSE_UNICODE is set to 1). <a href="#af8632260d14b0afcba0f2bc524ca2134"></a><br/></td></tr>
<tr class="separator:af8632260d14b0afcba0f2bc524ca2134"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:a9bcb820aebfdd3d3e50a929b01c52f8d"><td class="memItemLeft" align="right" valign="top">const wchar_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a9bcb820aebfdd3d3e50a929b01c52f8d">cWC2WX</a> (const wchar_t *psz) const </td></tr>
<tr class="memdesc:a9bcb820aebfdd3d3e50a929b01c52f8d"><td class="mdescLeft"> </td><td class="mdescRight">Converts from Unicode to the current wxChar type. <a href="#a9bcb820aebfdd3d3e50a929b01c52f8d"></a><br/></td></tr>
<tr class="separator:a9bcb820aebfdd3d3e50a929b01c52f8d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac6c7885e9186d5ce2786b49169c872f1"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_char_buffer.html">wxCharBuffer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#ac6c7885e9186d5ce2786b49169c872f1">cWC2WX</a> (const wchar_t *psz) const </td></tr>
<tr class="memdesc:ac6c7885e9186d5ce2786b49169c872f1"><td class="mdescLeft"> </td><td class="mdescRight">Converts from Unicode to the current wxChar type. <a href="#ac6c7885e9186d5ce2786b49169c872f1"></a><br/></td></tr>
<tr class="separator:ac6c7885e9186d5ce2786b49169c872f1"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:a15f4266aa96806bb5eebc9b1c4eaff05"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a15f4266aa96806bb5eebc9b1c4eaff05">cWX2MB</a> (const <a class="el" href="group__group__funcmacro__string.html#gad42f64d8c82f1ce4ae58773a89b2d6a7">wxChar</a> *psz) const </td></tr>
<tr class="memdesc:a15f4266aa96806bb5eebc9b1c4eaff05"><td class="mdescLeft"> </td><td class="mdescRight">Converts from the current wxChar type to multibyte encoding. <a href="#a15f4266aa96806bb5eebc9b1c4eaff05"></a><br/></td></tr>
<tr class="separator:a15f4266aa96806bb5eebc9b1c4eaff05"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3bbb71a7814c12dac290f6b61a3acc15"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_char_buffer.html">wxCharBuffer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a3bbb71a7814c12dac290f6b61a3acc15">cWX2MB</a> (const <a class="el" href="group__group__funcmacro__string.html#gad42f64d8c82f1ce4ae58773a89b2d6a7">wxChar</a> *psz) const </td></tr>
<tr class="memdesc:a3bbb71a7814c12dac290f6b61a3acc15"><td class="mdescLeft"> </td><td class="mdescRight">Converts from the current wxChar type to multibyte encoding. <a href="#a3bbb71a7814c12dac290f6b61a3acc15"></a><br/></td></tr>
<tr class="separator:a3bbb71a7814c12dac290f6b61a3acc15"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:ae08f0764f8acb6b075846c8bf126f57b"><td class="memItemLeft" align="right" valign="top">const wchar_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#ae08f0764f8acb6b075846c8bf126f57b">cWX2WC</a> (const <a class="el" href="group__group__funcmacro__string.html#gad42f64d8c82f1ce4ae58773a89b2d6a7">wxChar</a> *psz) const </td></tr>
<tr class="memdesc:ae08f0764f8acb6b075846c8bf126f57b"><td class="mdescLeft"> </td><td class="mdescRight">Converts from the current wxChar type to Unicode. <a href="#ae08f0764f8acb6b075846c8bf126f57b"></a><br/></td></tr>
<tr class="separator:ae08f0764f8acb6b075846c8bf126f57b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ab4eec03d83e532986aca1e41ad472bb8"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_w_char_buffer.html">wxWCharBuffer</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#ab4eec03d83e532986aca1e41ad472bb8">cWX2WC</a> (const <a class="el" href="group__group__funcmacro__string.html#gad42f64d8c82f1ce4ae58773a89b2d6a7">wxChar</a> *psz) const </td></tr>
<tr class="memdesc:ab4eec03d83e532986aca1e41ad472bb8"><td class="mdescLeft"> </td><td class="mdescRight">Converts from the current wxChar type to Unicode. <a href="#ab4eec03d83e532986aca1e41ad472bb8"></a><br/></td></tr>
<tr class="separator:ab4eec03d83e532986aca1e41ad472bb8"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a9d22d211135f265ed018e103590a61f0"><td class="memItemLeft" align="right" valign="top">static size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_m_b_conv.html#a9d22d211135f265ed018e103590a61f0">GetMaxMBNulLen</a> ()</td></tr>
<tr class="memdesc:a9d22d211135f265ed018e103590a61f0"><td class="mdescLeft"> </td><td class="mdescRight">Returns the maximal value which can be returned by <a class="el" href="classwx_m_b_conv.html#a2d6590cbcc686be76a9c4f1c071ff99f" title="This function returns 1 for most of the multibyte encodings in which the string is terminated by a si...">GetMBNulLen()</a> for any conversion object. <a href="#a9d22d211135f265ed018e103590a61f0"></a><br/></td></tr>
<tr class="separator:a9d22d211135f265ed018e103590a61f0"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="ab2348d20301679ce0cf5c565446b0080"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxMBConv::wxMBConv </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Trivial default constructor. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ae6fd1020a2c7c82191c4822682e80d05"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classwx_m_b_conv.html">wxMBConv</a>* wxMBConv::Clone </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This pure virtual function is overridden in each of the derived classes to return a new copy of the object it is called on. </p>
<p>It is used for copying the conversion objects while preserving their dynamic type. </p>
</div>
</div>
<a class="anchor" id="a0e572efeda6c5c73ddff1292609fa211"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_w_char_buffer.html">wxWCharBuffer</a> wxMBConv::cMB2WC </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>inLen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t * </td>
<td class="paramname"><em>outLen</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from multibyte encoding to Unicode by calling <a class="el" href="classwx_m_b_conv.html#a22ad1976c06a540a95dfa878038d65f2" title="Convert multibyte string to a wide character one.">ToWChar()</a> and allocating a temporary <a class="el" href="classwx_w_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for wchar_t type.">wxWCharBuffer</a> to hold the result. </p>
<p>This function is a convenient wrapper around <a class="el" href="classwx_m_b_conv.html#a22ad1976c06a540a95dfa878038d65f2" title="Convert multibyte string to a wide character one.">ToWChar()</a> as it takes care of allocating the buffer of the necessary size itself. Its parameters have the same meaning as for <a class="el" href="classwx_m_b_conv.html#a22ad1976c06a540a95dfa878038d65f2" title="Convert multibyte string to a wide character one.">ToWChar()</a>, in particular <em>inLen</em> can be specified explicitly in which case exactly that many characters are converted and <em>outLen</em> receives (if non-<span class="literal">NULL</span>) exactly the corresponding number of wide characters, whether the last one of them is <code>NUL</code> or not. However if <code>inLen</code> is <code>wxNO_LEN</code>, then <code>outLen</code> doesn't count the trailing <code>NUL</code> even if it is always present in this case.</p>
<p>Finally notice that if the conversion fails, the returned buffer is invalid and <em>outLen</em> is set to 0 (and not <code>wxCONV_FAILED</code> for compatibility concerns). </p>
</div>
</div>
<a class="anchor" id="aced3961b0bdad13f390343b2b70d49b1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_w_char_buffer.html">wxWCharBuffer</a> wxMBConv::cMB2WC </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_char_buffer.html">wxCharBuffer</a> & </td>
<td class="paramname"><em>buf</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts a char buffer to wide char one. </p>
<p>This is the most convenient and safest conversion function as you don't have to deal with the buffer lengths directly. Use it if the input buffer is known not to be empty or if you are sure that the conversion is going to succeed – otherwise, use the overload above to be able to distinguish between empty input and conversion failure.</p>
<dl class="section return"><dt>Returns</dt><dd>The buffer containing the converted text, empty if the input was empty or if the conversion failed.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>2.9.1 </dd></dl>
</div>
</div>
<a class="anchor" id="a62b723fea6758812e786a3ec5797f8ba"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* wxMBConv::cMB2WX </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>psz</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from multibyte encoding to the current wxChar type (which depends on whether wxUSE_UNICODE is set to 1). </p>
<p>If wxChar is char, it returns the parameter unaltered. If wxChar is wchar_t, it returns the result in a <a class="el" href="classwx_w_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for wchar_t type.">wxWCharBuffer</a>. The macro wxMB2WXbuf is defined as the correct return type (without const). </p>
</div>
</div>
<a class="anchor" id="af8632260d14b0afcba0f2bc524ca2134"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_w_char_buffer.html">wxWCharBuffer</a> wxMBConv::cMB2WX </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>psz</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from multibyte encoding to the current wxChar type (which depends on whether wxUSE_UNICODE is set to 1). </p>
<p>If wxChar is char, it returns the parameter unaltered. If wxChar is wchar_t, it returns the result in a <a class="el" href="classwx_w_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for wchar_t type.">wxWCharBuffer</a>. The macro wxMB2WXbuf is defined as the correct return type (without const). </p>
</div>
</div>
<a class="anchor" id="a496c808fc769800659e5de1a74115a54"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_char_buffer.html">wxCharBuffer</a> wxMBConv::cWC2MB </td>
<td>(</td>
<td class="paramtype">const wchar_t * </td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>inLen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t * </td>
<td class="paramname"><em>outLen</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from Unicode to multibyte encoding by calling <a class="el" href="classwx_m_b_conv.html#a149c15b515e008fdd1f69a852f11594e" title="Converts wide character string to multibyte.">FromWChar()</a> and allocating a temporary <a class="el" href="classwx_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for char type.">wxCharBuffer</a> to hold the result. </p>
<p>This function is a convenient wrapper around <a class="el" href="classwx_m_b_conv.html#a149c15b515e008fdd1f69a852f11594e" title="Converts wide character string to multibyte.">FromWChar()</a> as it takes care of allocating the buffer of necessary size itself.</p>
<p>Its parameters have the same meaning as the corresponding parameters of <a class="el" href="classwx_m_b_conv.html#a149c15b515e008fdd1f69a852f11594e" title="Converts wide character string to multibyte.">FromWChar()</a>, please see the description of <a class="el" href="classwx_m_b_conv.html#a0e572efeda6c5c73ddff1292609fa211" title="Converts from multibyte encoding to Unicode by calling ToWChar() and allocating a temporary wxWCharBu...">cMB2WC()</a> for more details. </p>
</div>
</div>
<a class="anchor" id="a34d1ea0725e5001e4f74a5dbf5c81c4f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_char_buffer.html">wxCharBuffer</a> wxMBConv::cWC2MB </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_w_char_buffer.html">wxWCharBuffer</a> & </td>
<td class="paramname"><em>buf</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts a wide char buffer to char one. </p>
<p>This is the most convenient and safest conversion function as you don't have to deal with the buffer lengths directly. Use it if the input buffer is known not to be empty or if you are sure that the conversion is going to succeed – otherwise, use the overload above to be able to distinguish between empty input and conversion failure.</p>
<dl class="section return"><dt>Returns</dt><dd>The buffer containing the converted text, empty if the input was empty or if the conversion failed.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>2.9.1 </dd></dl>
</div>
</div>
<a class="anchor" id="a9bcb820aebfdd3d3e50a929b01c52f8d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const wchar_t* wxMBConv::cWC2WX </td>
<td>(</td>
<td class="paramtype">const wchar_t * </td>
<td class="paramname"><em>psz</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from Unicode to the current wxChar type. </p>
<p>If wxChar is wchar_t, it returns the parameter unaltered. If wxChar is char, it returns the result in a <a class="el" href="classwx_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for char type.">wxCharBuffer</a>. The macro wxWC2WXbuf is defined as the correct return type (without const). </p>
</div>
</div>
<a class="anchor" id="ac6c7885e9186d5ce2786b49169c872f1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_char_buffer.html">wxCharBuffer</a> wxMBConv::cWC2WX </td>
<td>(</td>
<td class="paramtype">const wchar_t * </td>
<td class="paramname"><em>psz</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from Unicode to the current wxChar type. </p>
<p>If wxChar is wchar_t, it returns the parameter unaltered. If wxChar is char, it returns the result in a <a class="el" href="classwx_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for char type.">wxCharBuffer</a>. The macro wxWC2WXbuf is defined as the correct return type (without const). </p>
</div>
</div>
<a class="anchor" id="a15f4266aa96806bb5eebc9b1c4eaff05"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* wxMBConv::cWX2MB </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="group__group__funcmacro__string.html#gad42f64d8c82f1ce4ae58773a89b2d6a7">wxChar</a> * </td>
<td class="paramname"><em>psz</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from the current wxChar type to multibyte encoding. </p>
<p>If wxChar is char, it returns the parameter unaltered. If wxChar is wchar_t, it returns the result in a <a class="el" href="classwx_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for char type.">wxCharBuffer</a>. The macro wxWX2MBbuf is defined as the correct return type (without const). </p>
</div>
</div>
<a class="anchor" id="a3bbb71a7814c12dac290f6b61a3acc15"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_char_buffer.html">wxCharBuffer</a> wxMBConv::cWX2MB </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="group__group__funcmacro__string.html#gad42f64d8c82f1ce4ae58773a89b2d6a7">wxChar</a> * </td>
<td class="paramname"><em>psz</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from the current wxChar type to multibyte encoding. </p>
<p>If wxChar is char, it returns the parameter unaltered. If wxChar is wchar_t, it returns the result in a <a class="el" href="classwx_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for char type.">wxCharBuffer</a>. The macro wxWX2MBbuf is defined as the correct return type (without const). </p>
</div>
</div>
<a class="anchor" id="ae08f0764f8acb6b075846c8bf126f57b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const wchar_t* wxMBConv::cWX2WC </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="group__group__funcmacro__string.html#gad42f64d8c82f1ce4ae58773a89b2d6a7">wxChar</a> * </td>
<td class="paramname"><em>psz</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from the current wxChar type to Unicode. </p>
<p>If wxChar is wchar_t, it returns the parameter unaltered. If wxChar is char, it returns the result in a <a class="el" href="classwx_w_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for wchar_t type.">wxWCharBuffer</a>. The macro wxWX2WCbuf is defined as the correct return type (without const). </p>
</div>
</div>
<a class="anchor" id="ab4eec03d83e532986aca1e41ad472bb8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_w_char_buffer.html">wxWCharBuffer</a> wxMBConv::cWX2WC </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="group__group__funcmacro__string.html#gad42f64d8c82f1ce4ae58773a89b2d6a7">wxChar</a> * </td>
<td class="paramname"><em>psz</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts from the current wxChar type to Unicode. </p>
<p>If wxChar is wchar_t, it returns the parameter unaltered. If wxChar is char, it returns the result in a <a class="el" href="classwx_w_char_buffer.html" title="This is a specialization of wxCharTypeBuffer<T> for wchar_t type.">wxWCharBuffer</a>. The macro wxWX2WCbuf is defined as the correct return type (without const). </p>
</div>
</div>
<a class="anchor" id="a149c15b515e008fdd1f69a852f11594e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual size_t wxMBConv::FromWChar </td>
<td>(</td>
<td class="paramtype">char * </td>
<td class="paramname"><em>dst</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>dstLen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const wchar_t * </td>
<td class="paramname"><em>src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>srcLen</em> = <code>wxNO_LEN</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Converts wide character string to multibyte. </p>
<p>This function has the same semantics as <a class="el" href="classwx_m_b_conv.html#a22ad1976c06a540a95dfa878038d65f2" title="Convert multibyte string to a wide character one.">ToWChar()</a> except that it converts a wide string to multibyte one. As with <a class="el" href="classwx_m_b_conv.html#a22ad1976c06a540a95dfa878038d65f2" title="Convert multibyte string to a wide character one.">ToWChar()</a>, it may be more convenient to use <a class="el" href="classwx_m_b_conv.html#a496c808fc769800659e5de1a74115a54" title="Converts from Unicode to multibyte encoding by calling FromWChar() and allocating a temporary wxCharB...">cWC2MB()</a> when working with <code>NUL</code> terminated strings.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dst</td><td>Pointer to output buffer of the size of at least <em>dstLen</em> or <span class="literal">NULL</span>. </td></tr>
<tr><td class="paramname">dstLen</td><td>Maximal number of characters to be written to the output buffer if <em>dst</em> is non-<span class="literal">NULL</span>, unused otherwise. </td></tr>
<tr><td class="paramname">src</td><td>Point to the source string, must not be <span class="literal">NULL</span>. </td></tr>
<tr><td class="paramname">srcLen</td><td>The number of characters of the source string to convert or <code>wxNO_LEN</code> (default parameter) to convert everything up to and including the terminating <code>NUL</code> character.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of character written (or which would have been written if it were non-<span class="literal">NULL</span>) to <em>dst</em> or <code>wxCONV_FAILED</code> on error. </dd></dl>
</div>
</div>
<a class="anchor" id="a9d22d211135f265ed018e103590a61f0"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static size_t wxMBConv::GetMaxMBNulLen </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the maximal value which can be returned by <a class="el" href="classwx_m_b_conv.html#a2d6590cbcc686be76a9c4f1c071ff99f" title="This function returns 1 for most of the multibyte encodings in which the string is terminated by a si...">GetMBNulLen()</a> for any conversion object. </p>
<p>Currently this value is 4.</p>
<p>This method can be used to allocate the buffer with enough space for the trailing <code>NUL</code> characters for any encoding. </p>
</div>
</div>
<a class="anchor" id="a2d6590cbcc686be76a9c4f1c071ff99f"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual size_t wxMBConv::GetMBNulLen </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This function returns 1 for most of the multibyte encodings in which the string is terminated by a single <code>NUL</code>, 2 for UTF-16 and 4 for UTF-32 for which the string is terminated with 2 and 4 <code>NUL</code> characters respectively. </p>
<p>The other cases are not currently supported and <code>wxCONV_FAILED</code> (defined as -1) is returned for them. </p>
</div>
</div>
<a class="anchor" id="a79d63eff51836148157c986943835742"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual size_t wxMBConv::MB2WC </td>
<td>(</td>
<td class="paramtype">wchar_t * </td>
<td class="paramname"><em>out</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>in</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>outLen</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000051">Deprecated:</a></b></dt><dd>This function is deprecated, please use <a class="el" href="classwx_m_b_conv.html#a22ad1976c06a540a95dfa878038d65f2" title="Convert multibyte string to a wide character one.">ToWChar()</a> instead.</dd></dl>
<p>Converts from a string <em>in</em> multibyte encoding to Unicode putting up to <em>outLen</em> characters into the buffer <em>out</em>.</p>
<p>If <em>out</em> is <span class="literal">NULL</span>, only the length of the string which would result from the conversion is calculated and returned. Note that this is the length and not size, i.e. the returned value does not include the trailing <code>NUL</code>. But when the function is called with a non-<span class="literal">NULL</span> <em>out</em> buffer, the <em>outLen</em> parameter should be one more to allow to properly <code>NUL-terminate</code> the string.</p>
<p>So to properly use this function you need to write: </p>
<div class="fragment"><div class="line"><span class="keywordtype">size_t</span> lenConv = conv.MB2WC(NULL, in, 0);</div>
<div class="line"><span class="keywordflow">if</span> ( lenConv == wxCONV_FAILED )</div>
<div class="line"> ... handle error ...</div>
<div class="line"><span class="comment">// allocate 1 more character for the trailing NUL and also pass</span></div>
<div class="line"><span class="comment">// the size of the buffer to the function now</span></div>
<div class="line">wchar_t *out = <span class="keyword">new</span> <span class="keywordtype">wchar_t</span>[lenConv + 1];</div>
<div class="line"><span class="keywordflow">if</span> ( conv.MB2WC(out, in, lenConv + 1) == wxCONV_FAILED )</div>
<div class="line"> ... handle error ...</div>
</div><!-- fragment --><p> For this and other reasons, <a class="el" href="classwx_m_b_conv.html#a22ad1976c06a540a95dfa878038d65f2" title="Convert multibyte string to a wide character one.">ToWChar()</a> is strongly recommended as a replacement.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">out</td><td>The output buffer, may be <span class="literal">NULL</span> if the caller is only interested in the length of the resulting string </td></tr>
<tr><td class="paramname">in</td><td>The NUL-terminated input string, cannot be <span class="literal">NULL</span> </td></tr>
<tr><td class="paramname">outLen</td><td>The length of the output buffer but including NUL, ignored if out is <span class="literal">NULL</span></td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The length of the converted string excluding the trailing NUL. </dd></dl>
</div>
</div>
<a class="anchor" id="a22ad1976c06a540a95dfa878038d65f2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual size_t wxMBConv::ToWChar </td>
<td>(</td>
<td class="paramtype">wchar_t * </td>
<td class="paramname"><em>dst</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>dstLen</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>src</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>srcLen</em> = <code>wxNO_LEN</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Convert multibyte string to a wide character one. </p>
<p>This is the most general function for converting a multibyte string to a wide string, <a class="el" href="classwx_m_b_conv.html#a0e572efeda6c5c73ddff1292609fa211" title="Converts from multibyte encoding to Unicode by calling ToWChar() and allocating a temporary wxWCharBu...">cMB2WC()</a> may be often more convenient, however this function is the most efficient one as it allows to avoid any unnecessary copying.</p>
<p>The main case is when <em>dst</em> is not <span class="literal">NULL</span> and <em>srcLen</em> is not <code>wxNO_LEN</code> (which is defined as <code></code>(size_t)-1): then the function converts exactly <em>srcLen</em> bytes starting at <em>src</em> into wide string which it output to <em>dst</em>. If the length of the resulting wide string is greater than <em>dstLen</em>, an error is returned. Note that if <em>srcLen</em> bytes don't include <code>NUL</code> characters, the resulting wide string is not <code>NUL-terminated</code> neither.</p>
<p>If <em>srcLen</em> is <code>wxNO_LEN</code>, the function supposes that the string is properly (i.e. as necessary for the encoding handled by this conversion) <code>NUL-terminated</code> and converts the entire string, including any trailing <code>NUL</code> bytes. In this case the wide string is also <code>NUL-terminated</code>.</p>
<p>Finally, if <em>dst</em> is <span class="literal">NULL</span>, the function returns the length of the needed buffer.</p>
<p>Example of use of this function: </p>
<div class="fragment"><div class="line"><span class="keywordtype">size_t</span> dstLen = conv.ToWChar(NULL, 0, src);</div>
<div class="line"><span class="keywordflow">if</span> ( dstLen == wxCONV_FAILED )</div>
<div class="line"> ... handle error ...</div>
<div class="line">wchar_t *dst = <span class="keyword">new</span> <span class="keywordtype">wchar_t</span>[dstLen];</div>
<div class="line"><span class="keywordflow">if</span> ( conv.ToWChar(dst, dstLen, src) == wxCONV_FAILED )</div>
<div class="line"> ... handle error ...</div>
</div><!-- fragment --><p>Notice that when passing the explicit source length the output will <em>not</em> be <code>NUL</code> terminated if you pass <code>strlen(str)</code> as parameter. Either leave <em>srcLen</em> as default <code>wxNO_LEN</code> or add one to <code>strlen</code> result if you want the output to be <code>NUL</code> terminated.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">dst</td><td>Pointer to output buffer of the size of at least <em>dstLen</em> or <span class="literal">NULL</span>. </td></tr>
<tr><td class="paramname">dstLen</td><td>Maximal number of characters to be written to the output buffer if <em>dst</em> is non-<span class="literal">NULL</span>, unused otherwise. </td></tr>
<tr><td class="paramname">src</td><td>Point to the source string, must not be <span class="literal">NULL</span>. </td></tr>
<tr><td class="paramname">srcLen</td><td>The number of characters of the source string to convert or <code>wxNO_LEN</code> (default parameter) to convert everything up to and including the terminating <code>NUL</code> character(s).</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of character written (or which would have been written if it were non-<span class="literal">NULL</span>) to <em>dst</em> or <code>wxCONV_FAILED</code> on error. </dd></dl>
</div>
</div>
<a class="anchor" id="a537a0f90ab4738e3e9be58d9a77b71b1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual size_t wxMBConv::WC2MB </td>
<td>(</td>
<td class="paramtype">char * </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const wchar_t * </td>
<td class="paramname"><em>psz</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>n</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000052">Deprecated:</a></b></dt><dd>This function is deprecated, please use <a class="el" href="classwx_m_b_conv.html#a149c15b515e008fdd1f69a852f11594e" title="Converts wide character string to multibyte.">FromWChar()</a> instead.</dd></dl>
<p>Converts from Unicode to multibyte encoding. The semantics of this function (including the return value meaning) is the same as for <a class="el" href="classwx_m_b_conv.html#a79d63eff51836148157c986943835742">wxMBConv::MB2WC</a>. Notice that when the function is called with a non-<span class="literal">NULL</span> buffer, the <em>n</em> parameter should be the size of the buffer and so it should take into account the trailing <code>NUL</code>, which might take two or four bytes for some encodings (UTF-16 and UTF-32) and not one, i.e. <a class="el" href="classwx_m_b_conv.html#a2d6590cbcc686be76a9c4f1c071ff99f" title="This function returns 1 for most of the multibyte encodings in which the string is terminated by a si...">GetMBNulLen()</a>. </p>
</div>
</div>
</div><!-- contents -->
<address class="footer">
<small>
Generated on Thu Nov 27 2014 13:46:50 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>
|