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 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Wt: Wt::WString Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<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>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>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</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 class="navpath"><a class="el" href="namespaceWt.html">Wt</a>::<a class="el" href="classWt_1_1WString.html">WString</a>
</div>
</div>
<div class="contents">
<h1>Wt::WString Class Reference</h1><!-- doxytag: class="Wt::WString" -->A unicode string class, with support for localization.
<a href="#_details">More...</a>
<p>
<code>#include <Wt/WString></code>
<p>
<p>
<a href="classWt_1_1WString-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="classWt_1_1WString.html#b1118313feb49fd2a1f7eab40f7f7a56">WString</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates an empty string. <a href="#b1118313feb49fd2a1f7eab40f7f7a56"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#1259e1f8285f3e04ef62fb59e6c83f4e">WString</a> (const wchar_t *value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a WString from a wide C string. <a href="#1259e1f8285f3e04ef62fb59e6c83f4e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="22fb311a713484d978b52b6787910da7"></a><!-- doxytag: member="Wt::WString::WString" ref="22fb311a713484d978b52b6787910da7" args="(const WString &other)" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#22fb311a713484d978b52b6787910da7">WString</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &other)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Copy constructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#217c6be8205e02d3e2580b6c59357bb6">WString</a> (const std::wstring &value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a WString from a wide C++ string. <a href="#217c6be8205e02d3e2580b6c59357bb6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#a1e577f4cf6352a3a657fde3f7d3034e">WString</a> (const char *value, <a class="el" href="classWt_1_1WString.html#55b820090cc9d15753301df90e35fd52">CharEncoding</a> encoding=LocalEncoding)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a WString from a C string. <a href="#a1e577f4cf6352a3a657fde3f7d3034e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#d2b612d535553feb1e4d08347f5475b1">WString</a> (const char *value, const std::locale &loc)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a WString from a C string. <a href="#d2b612d535553feb1e4d08347f5475b1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#65df74efecfae4e46c68fe3ff28ff81d">WString</a> (const std::string &value, <a class="el" href="classWt_1_1WString.html#55b820090cc9d15753301df90e35fd52">CharEncoding</a> encoding=LocalEncoding)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a WString from a C++ string. <a href="#65df74efecfae4e46c68fe3ff28ff81d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#5aaf5904a4293de24d79ec953cf0d3b6">WString</a> (const std::string &value, const std::locale &loc)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a WString from a C++ string. <a href="#5aaf5904a4293de24d79ec953cf0d3b6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d3e7e1481f31514ecf58a6a344ec6ca6"></a><!-- doxytag: member="Wt::WString::~WString" ref="d3e7e1481f31514ecf58a6a344ec6ca6" args="()" -->
</td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#d3e7e1481f31514ecf58a6a344ec6ca6">~WString</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#fbd9254fb159d682ed4a2227a7ec69b7">operator=</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Assignment operator. <a href="#fbd9254fb159d682ed4a2227a7ec69b7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#5a1bf5761127553e8189a278525af71c">operator==</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Comparison operator. <a href="#5a1bf5761127553e8189a278525af71c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#ccc7df36ce3febb1b2e1c297b30fafd2">operator<</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Comparison operator. <a href="#ccc7df36ce3febb1b2e1c297b30fafd2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#111e77b8cf401664d191eaf3f85867b1">operator></a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Comparison operator. <a href="#111e77b8cf401664d191eaf3f85867b1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#bb46a3098a1a185a3498fbcf4c714c7b">operator+=</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Self-concatenation operator. <a href="#bb46a3098a1a185a3498fbcf4c714c7b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#0c455e324e5e756c456cd662f829373c">operator+=</a> (const std::wstring &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Self-concatenation operator. <a href="#0c455e324e5e756c456cd662f829373c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#64bbf435dfe82342ce43faf9c48ee28f">operator+=</a> (const wchar_t *rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Self-concatenation operator. <a href="#64bbf435dfe82342ce43faf9c48ee28f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#36d097b2ed9a2e921ad2d6a79bc3dd25">operator+=</a> (const std::string &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Self-concatenation operator. <a href="#36d097b2ed9a2e921ad2d6a79bc3dd25"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#cac4b0bc682e0789edc2976883ed7a5a">operator+=</a> (const char *rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Self-concatenation operator. <a href="#cac4b0bc682e0789edc2976883ed7a5a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="87a90e69ab25d62ba029e10ea244abaf"></a><!-- doxytag: member="Wt::WString::empty" ref="87a90e69ab25d62ba029e10ea244abaf" args="() const " -->
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#87a90e69ab25d62ba029e10ea244abaf">empty</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns whether the string is empty. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#159d088da6e8f2be1035b2341889254c">toUTF8</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the value as a UTF8 unicode encoded string. <a href="#159d088da6e8f2be1035b2341889254c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::wstring </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#b76d45947986f8aa20763cf99267ec23">value</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the value as a wide C++ string. <a href="#b76d45947986f8aa20763cf99267ec23"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#0b90340ac2dbacb9b4d81e92d9070066">narrow</a> (const std::locale &loc=std::locale()) const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the value as a narrow C++ string. <a href="#0b90340ac2dbacb9b4d81e92d9070066"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#af8a69faf2551af5afb4757fd02f631b">operator std::wstring</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the value as a wide C++ string. <a href="#af8a69faf2551af5afb4757fd02f631b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#61a714a97bb6d70d60be6f9a1997e636">literal</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retuns whether the string is literal or localized. <a href="#61a714a97bb6d70d60be6f9a1997e636"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#18807776c41bdaebd7264bbabdd2282a">key</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the key for a localized string. <a href="#18807776c41bdaebd7264bbabdd2282a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#1c3d0d7790282777ce13edececfe0095">arg</a> (const std::wstring &value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Substitutes the next positional argument with a string value. <a href="#1c3d0d7790282777ce13edececfe0095"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#7da2111a8ca361ccd7d77df0232b3986">arg</a> (const std::string &value, <a class="el" href="classWt_1_1WString.html#55b820090cc9d15753301df90e35fd52">CharEncoding</a>=LocalEncoding)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Substitutes the next positional argument with a string value. <a href="#7da2111a8ca361ccd7d77df0232b3986"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#4761af728bf3cc5bca4ae3770243883e">arg</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Substitutes the next positional argument with a string value. <a href="#4761af728bf3cc5bca4ae3770243883e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#167d99295d497bc37c11893c175e7e02">arg</a> (int value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Substitutes the next positional argument with an integer value. <a href="#167d99295d497bc37c11893c175e7e02"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classWt_1_1WString.html">WString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#adfe619a23256dab80fd238c6e4ad7d7">arg</a> (double value)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Substitutes the next positional argument with a double value. <a href="#adfe619a23256dab80fd238c6e4ad7d7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const std::vector< std::string > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#59dcc59bd1bc95984f2add4e32e914c0">args</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the list of arguments. <a href="#59dcc59bd1bc95984f2add4e32e914c0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#545b18b7e07b4596281970ca1599430b">refresh</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Refreshes the string. <a href="#545b18b7e07b4596281970ca1599430b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#bcdf277c20807ab963effd7e54732fa8">jsStringLiteral</a> (char delimiter= '\'') const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the string as a JavaScript literal. <a href="#bcdf277c20807ab963effd7e54732fa8"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#17afc7c43b5b7a710047be4a2c639575">fromUTF8</a> (const std::string &value, bool checkValid=false)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a WString from a UTF8 unicode encoded string. <a href="#17afc7c43b5b7a710047be4a2c639575"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#4fbd5cdc92e39411de45acb680b1206b">fromUTF8</a> (const char *value, bool checkValid=false)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a WString from a UTF8 unicode encoded string. <a href="#4fbd5cdc92e39411de45acb680b1206b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#0afc7dc0f9897456d71b569a86ca26c1">tr</a> (const char *key)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a localized string from a key. <a href="#0afc7dc0f9897456d71b569a86ca26c1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#42a4aad50b5a1633b1cfef4c0ffa044a">tr</a> (const std::string &key)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Creates a localized string with the specified key. <a href="#42a4aad50b5a1633b1cfef4c0ffa044a"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="511a12bce677dc733bd7b6b9415bff73"></a><!-- doxytag: member="Wt::WString::Empty" ref="511a12bce677dc733bd7b6b9415bff73" args="" -->
static const <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#511a12bce677dc733bd7b6b9415bff73">Empty</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">An emtpy string. <br></td></tr>
<tr><td colspan="2"><br><h2>Related Functions</h2></td></tr>
<tr><td colspan="2">(Note that these are not member functions.) <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#55b820090cc9d15753301df90e35fd52">CharEncoding</a> { <a class="el" href="namespaceWt.html#55b820090cc9d15753301df90e35fd52e31c944a7e88c44611f9317e7c1223e3">LocalEncoding</a>,
<a class="el" href="namespaceWt.html#55b820090cc9d15753301df90e35fd5292c04a55980fec5344377e55b271cfd0">UTF8</a>
}</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Enumeration that indicates a character encoding. <a href="classWt_1_1WString.html#55b820090cc9d15753301df90e35fd52">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#552bc8e01a4bc1c6ba53607c414a82b7">WMessage</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Alias for WString (<b>deprecated</b>). <a href="#552bc8e01a4bc1c6ba53607c414a82b7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8e74a971d0d341af51ffcc77fc4c5f29"></a><!-- doxytag: member="Wt::WString::operator+" ref="8e74a971d0d341af51ffcc77fc4c5f29" args="(const WString &lhs, const WString &rhs)" -->
WT_API <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#8e74a971d0d341af51ffcc77fc4c5f29">operator+</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Concatenate two WStrings. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="20e373795a949c805d82cd7793ce0847"></a><!-- doxytag: member="Wt::WString::operator+" ref="20e373795a949c805d82cd7793ce0847" args="(const WString &lhs, const std::wstring &rhs)" -->
WT_API <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#20e373795a949c805d82cd7793ce0847">operator+</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &lhs, const std::wstring &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Conatenate a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a> with a C++ wide string. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="29b92c396a6bdc6703a38c2da0822065"></a><!-- doxytag: member="Wt::WString::operator+" ref="29b92c396a6bdc6703a38c2da0822065" args="(const WString &lhs, const wchar_t *rhs)" -->
WT_API <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#29b92c396a6bdc6703a38c2da0822065">operator+</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &lhs, const wchar_t *rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Conatenate a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a> with a C wide string. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="bf52ea1a14eff4dc0f19fc089c499b58"></a><!-- doxytag: member="Wt::WString::operator+" ref="bf52ea1a14eff4dc0f19fc089c499b58" args="(const WString &lhs, const std::string &rhs)" -->
WT_API <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#bf52ea1a14eff4dc0f19fc089c499b58">operator+</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &lhs, const std::string &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Conatenate a WStrin with a C++ string. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8358446c46d0433f3f080698e271b91f"></a><!-- doxytag: member="Wt::WString::operator+" ref="8358446c46d0433f3f080698e271b91f" args="(const WString &lhs, const char *rhs)" -->
WT_API <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#8358446c46d0433f3f080698e271b91f">operator+</a> (const <a class="el" href="classWt_1_1WString.html">WString</a> &lhs, const char *rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Conatenate a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a> with a C string. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c5c8dce7d5d1e3a9abe13a9d9093fbb2"></a><!-- doxytag: member="Wt::WString::operator+" ref="c5c8dce7d5d1e3a9abe13a9d9093fbb2" args="(const std::wstring &lhs, const WString &rhs)" -->
WT_API <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#c5c8dce7d5d1e3a9abe13a9d9093fbb2">operator+</a> (const std::wstring &lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Conatenate a C++ wide string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="ec7aea6adc509be52d4852cdad577aa7"></a><!-- doxytag: member="Wt::WString::operator+" ref="ec7aea6adc509be52d4852cdad577aa7" args="(const wchar_t *lhs, const WString &rhs)" -->
WT_API <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#ec7aea6adc509be52d4852cdad577aa7">operator+</a> (const wchar_t *lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Conatenate a C wide string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="de2e90e8c1b589d5c7cde214e05953bb"></a><!-- doxytag: member="Wt::WString::operator+" ref="de2e90e8c1b589d5c7cde214e05953bb" args="(const std::string &lhs, const WString &rhs)" -->
WT_API <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#de2e90e8c1b589d5c7cde214e05953bb">operator+</a> (const std::string &lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Conatenate a C++ string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="21c7b1899a0c1fefb22cad296605c66b"></a><!-- doxytag: member="Wt::WString::operator+" ref="21c7b1899a0c1fefb22cad296605c66b" args="(const char *lhs, const WString &rhs)" -->
WT_API <a class="el" href="classWt_1_1WString.html">WString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#21c7b1899a0c1fefb22cad296605c66b">operator+</a> (const char *lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Conatenate a C string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="902005eafdaa7adc292dfb384feed65f"></a><!-- doxytag: member="Wt::WString::operator==" ref="902005eafdaa7adc292dfb384feed65f" args="(const char *lhs, const WString &rhs)" -->
WT_API bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#902005eafdaa7adc292dfb384feed65f">operator==</a> (const char *lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare a C string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="8b3b3574ae5e0eb9d8a74663a7ef52ad"></a><!-- doxytag: member="Wt::WString::operator==" ref="8b3b3574ae5e0eb9d8a74663a7ef52ad" args="(const wchar_t *lhs, const WString &rhs)" -->
WT_API bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#8b3b3574ae5e0eb9d8a74663a7ef52ad">operator==</a> (const wchar_t *lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare a C wide string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="afe1405efe5edabdb5fa11a2f0891899"></a><!-- doxytag: member="Wt::WString::operator==" ref="afe1405efe5edabdb5fa11a2f0891899" args="(const std::string &lhs, const WString &rhs)" -->
WT_API bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#afe1405efe5edabdb5fa11a2f0891899">operator==</a> (const std::string &lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare a C++ string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="18fa1117aac536af9a3eeaf4a06d33e6"></a><!-- doxytag: member="Wt::WString::operator==" ref="18fa1117aac536af9a3eeaf4a06d33e6" args="(const std::wstring &lhs, const WString &rhs)" -->
WT_API bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#18fa1117aac536af9a3eeaf4a06d33e6">operator==</a> (const std::wstring &lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare a C++ wide string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="5be68db1207e42e9cb78584aada52b7e"></a><!-- doxytag: member="Wt::WString::operator!=" ref="5be68db1207e42e9cb78584aada52b7e" args="(const char *lhs, const WString &rhs)" -->
WT_API bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#5be68db1207e42e9cb78584aada52b7e">operator!=</a> (const char *lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare a C string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dd2140b578bed246c41705506987ce8d"></a><!-- doxytag: member="Wt::WString::operator!=" ref="dd2140b578bed246c41705506987ce8d" args="(const wchar_t *lhs, const WString &rhs)" -->
WT_API bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#dd2140b578bed246c41705506987ce8d">operator!=</a> (const wchar_t *lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare a C wide string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="39afb0dc0c18f1c4ae9a1c36fd061722"></a><!-- doxytag: member="Wt::WString::operator!=" ref="39afb0dc0c18f1c4ae9a1c36fd061722" args="(const std::string &lhs, const WString &rhs)" -->
WT_API bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#39afb0dc0c18f1c4ae9a1c36fd061722">operator!=</a> (const std::string &lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare a C++ string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4bbceb2c54d45a3b0b6bc55d15a17dba"></a><!-- doxytag: member="Wt::WString::operator!=" ref="4bbceb2c54d45a3b0b6bc55d15a17dba" args="(const std::wstring &lhs, const WString &rhs)" -->
WT_API bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#4bbceb2c54d45a3b0b6bc55d15a17dba">operator!=</a> (const std::wstring &lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compare a C++ wide string with a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="82f539b8c205675c9c9f4d5d42cc9c57"></a><!-- doxytag: member="Wt::WString::operator<<" ref="82f539b8c205675c9c9f4d5d42cc9c57" args="(std::wostream &lhs, const WString &rhs)" -->
WT_API std::wostream & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#82f539b8c205675c9c9f4d5d42cc9c57">operator<<</a> (std::wostream &lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Output a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a> to a C++ wide stream. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">WT_API std::ostream & </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#5175831fb21a4e6245bfde54c5aaa3d2">operator<<</a> (std::ostream &lhs, const <a class="el" href="classWt_1_1WString.html">WString</a> &rhs)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Output a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a> to a C++ stream. <a href="#5175831fb21a4e6245bfde54c5aaa3d2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">WT_API std::wstring </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#0de7f8ee205f8a3368d6428e4b474f11">widen</a> (const std::string &s, const std::locale &loc=std::locale())</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert a narrow to a wide string. <a href="#0de7f8ee205f8a3368d6428e4b474f11"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">WT_API std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#2986eba78638de302685abc4f8e694d0">narrow</a> (const std::wstring &s, const std::locale &loc=std::locale())</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert a wide to a narrow string. <a href="#2986eba78638de302685abc4f8e694d0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">WT_API std::wstring </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#a5e236feac365794b288fd04a461406b">fromUTF8</a> (const std::string &s)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Decode a UTF8 string a wide string. <a href="#a5e236feac365794b288fd04a461406b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">WT_API std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1WString.html#32dae81c17e873b041a85a8509c905a5">toUTF8</a> (const std::wstring &s)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Encode a wide string to UTF8. <a href="#32dae81c17e873b041a85a8509c905a5"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A unicode string class, with support for localization.
<p>
Wt offers this string to facilitate handling of unicode text through the user interface, and to offer support for localized text using message resource bundles.<p>
A WString may be constructed from a std::string, std::wstring or c-style strings (const char * and const wchar_t *), and converted to each of these strings taking into account the locale in which the Wt application runs on the web server. Independent of the locale on the web server, you may convert from and to UTF8 unicode encoded std::strings.<p>
By using the static functions <a class="el" href="classWt_1_1WString.html#0afc7dc0f9897456d71b569a86ca26c1" title="Creates a localized string from a key.">WString::tr()</a> (or <a class="el" href="classWt_1_1WWidget.html#a651f107ec7cf080faef6c435705fc44" title="Short hand for WString::tr().">WWidget::tr()</a>), one may construct a localized string. The key is used to retrieve its current value from the application's message-resource bundles.<p>
Argument place holder in a string, denoted using {<em>n</em>} for the <em>n</em>'th argument, may be substituted by values set using <a class="el" href="classWt_1_1WString.html#167d99295d497bc37c11893c175e7e02" title="Substitutes the next positional argument with an integer value.">arg(int)</a> and arg(std::string).<p>
WString is used by all built-in widgets for displayed text. By calling <a class="el" href="classWt_1_1WApplication.html#5c9cc1350019d69f154a2b44cdaf2596" title="Changes the locale.">WApplication::setLocale()</a> or <a class="el" href="classWt_1_1WApplication.html#02b9d8aa1b6c2d0dc9edc1b9c63f86dc" title="Refreshes the application.">WApplication::refresh()</a>, the contents of every WString is reevaluated in the new locale, by calling <a class="el" href="classWt_1_1WString.html#545b18b7e07b4596281970ca1599430b" title="Refreshes the string.">refresh()</a>. In this way, the contents of the whole user interface is adapted to a possibly changed locale.<p>
To benefit from the localization properties of WString, you should design your own widget classes to use WString in their interface for any text that is displayed. In this way, your own widgets will automatically, and without any extra effort, participate in a relocalization triggered by <a class="el" href="classWt_1_1WApplication.html#5c9cc1350019d69f154a2b44cdaf2596" title="Changes the locale.">WApplication::setLocale()</a>.<p>
This string class does not provide anything more than basic manipulations. Instead, you should convert to a standard library string class to manipulate the string contents and perform string algorithms on them. In particular, we recommend to use the conversion methods <a class="el" href="classWt_1_1WString.html#159d088da6e8f2be1035b2341889254c" title="Returns the value as a UTF8 unicode encoded string.">toUTF8()</a>, <a class="el" href="classWt_1_1WString.html#17afc7c43b5b7a710047be4a2c639575" title="Creates a WString from a UTF8 unicode encoded string.">fromUTF8()</a> and the <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>(..., <a class="el" href="namespaceWt.html#55b820090cc9d15753301df90e35fd5292c04a55980fec5344377e55b271cfd0">UTF8</a>) constructor to convert from and to UTF8 encoded std::strings. In this way, you can support the whole unicode character set, with backward compatible support for the standard 7-bit ASCII set. Since WString internally uses UTF8-encoding, and UTF8-encoding is used by the library for communication with the browser, there is no actual conversion overhead. Only when you need to run string algorithms that require the actual length of the string in number of characters, you would need to convert to a wide string representation such as std::wstring.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WApplication.html#5386565e35a58c94ccbbfab48f2212a4" title="Returns the message resource bundle.">WApplication::messageResourceBundle()</a> <p>
<a class="el" href="classWt_1_1WApplication.html#6e782f1f38a6f56e2024aab1a917a80b" title="Returns the current locale.">WApplication::locale()</a> </dd></dl>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="b1118313feb49fd2a1f7eab40f7f7a56"></a><!-- doxytag: member="Wt::WString::WString" ref="b1118313feb49fd2a1f7eab40f7f7a56" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::WString::WString </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates an empty string.
<p>
Create a literal string with empty contents ("").
</div>
</div><p>
<a class="anchor" name="1259e1f8285f3e04ef62fb59e6c83f4e"></a><!-- doxytag: member="Wt::WString::WString" ref="1259e1f8285f3e04ef62fb59e6c83f4e" args="(const wchar_t *value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::WString::WString </td>
<td>(</td>
<td class="paramtype">const wchar_t * </td>
<td class="paramname"> <em>value</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a WString from a wide C string.
<p>
The wide string is implicitly converted to proper unicode. Note that there are known issues with the portability of wchar_t since its width and encoding are platform dependent.
</div>
</div><p>
<a class="anchor" name="217c6be8205e02d3e2580b6c59357bb6"></a><!-- doxytag: member="Wt::WString::WString" ref="217c6be8205e02d3e2580b6c59357bb6" args="(const std::wstring &value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::WString::WString </td>
<td>(</td>
<td class="paramtype">const std::wstring & </td>
<td class="paramname"> <em>value</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a WString from a wide C++ string.
<p>
The wide string is implicitly converted to proper unicode. Note that there are known issues with the portability of wchar_t since its width and encoding are platform dependent.
</div>
</div><p>
<a class="anchor" name="a1e577f4cf6352a3a657fde3f7d3034e"></a><!-- doxytag: member="Wt::WString::WString" ref="a1e577f4cf6352a3a657fde3f7d3034e" args="(const char *value, CharEncoding encoding=LocalEncoding)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::WString::WString </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classWt_1_1WString.html#55b820090cc9d15753301df90e35fd52">CharEncoding</a> </td>
<td class="paramname"> <em>encoding</em> = <code>LocalEncoding</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a WString from a C string.
<p>
The C string is implicitly converted to unicode. When <code>encoding</code> is <a class="el" href="namespaceWt.html#55b820090cc9d15753301df90e35fd52e31c944a7e88c44611f9317e7c1223e3">LocalEncoding</a>, the current locale is used to interpret the C string. When encoding is <a class="el" href="namespaceWt.html#55b820090cc9d15753301df90e35fd5292c04a55980fec5344377e55b271cfd0">UTF8</a>, the C string is interpreted as a UTF8 encoded unicode string.
</div>
</div><p>
<a class="anchor" name="d2b612d535553feb1e4d08347f5475b1"></a><!-- doxytag: member="Wt::WString::WString" ref="d2b612d535553feb1e4d08347f5475b1" args="(const char *value, const std::locale &loc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::WString::WString </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::locale & </td>
<td class="paramname"> <em>loc</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a WString from a C string.
<p>
The C string is implicitly converted to unicode. The string is interpreted within the character set of the given locale.
</div>
</div><p>
<a class="anchor" name="65df74efecfae4e46c68fe3ff28ff81d"></a><!-- doxytag: member="Wt::WString::WString" ref="65df74efecfae4e46c68fe3ff28ff81d" args="(const std::string &value, CharEncoding encoding=LocalEncoding)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::WString::WString </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classWt_1_1WString.html#55b820090cc9d15753301df90e35fd52">CharEncoding</a> </td>
<td class="paramname"> <em>encoding</em> = <code>LocalEncoding</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a WString from a C++ string.
<p>
The C++ string is implicitly converted to unicode. When <code>encoding</code> is <a class="el" href="namespaceWt.html#55b820090cc9d15753301df90e35fd52e31c944a7e88c44611f9317e7c1223e3">LocalEncoding</a>, the current locale is used to interpret the C++ string. When encoding is <a class="el" href="namespaceWt.html#55b820090cc9d15753301df90e35fd5292c04a55980fec5344377e55b271cfd0">UTF8</a>, the C++ string is interpreted as a UTF8 encoded unicode string.
</div>
</div><p>
<a class="anchor" name="5aaf5904a4293de24d79ec953cf0d3b6"></a><!-- doxytag: member="Wt::WString::WString" ref="5aaf5904a4293de24d79ec953cf0d3b6" args="(const std::string &value, const std::locale &loc)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::WString::WString </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::locale & </td>
<td class="paramname"> <em>loc</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a WString from a C++ string.
<p>
The C++ string is implicitly converted to unicode. The string is interpreted within the character set of the given locale.
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="fbd9254fb159d682ed4a2227a7ec69b7"></a><!-- doxytag: member="Wt::WString::operator=" ref="fbd9254fb159d682ed4a2227a7ec69b7" args="(const WString &rhs)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>rhs</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Assignment operator.
<p>
Copy another string into this string.
</div>
</div><p>
<a class="anchor" name="5a1bf5761127553e8189a278525af71c"></a><!-- doxytag: member="Wt::WString::operator==" ref="5a1bf5761127553e8189a278525af71c" args="(const WString &rhs) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Wt::WString::operator== </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>rhs</em> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Comparison operator.
<p>
Compares to strings and returns <code>true</code> if the strings are exactly the same. This may require evaluating a localized string in the current locale.
</div>
</div><p>
<a class="anchor" name="ccc7df36ce3febb1b2e1c297b30fafd2"></a><!-- doxytag: member="Wt::WString::operator<" ref="ccc7df36ce3febb1b2e1c297b30fafd2" args="(const WString &rhs) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Wt::WString::operator< </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>rhs</em> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Comparison operator.
<p>
Compares to strings lexicographically. This may require evaluating a localized string in the current locale. The unicode representation of the strings are compared.
</div>
</div><p>
<a class="anchor" name="111e77b8cf401664d191eaf3f85867b1"></a><!-- doxytag: member="Wt::WString::operator>" ref="111e77b8cf401664d191eaf3f85867b1" args="(const WString &rhs) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Wt::WString::operator> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>rhs</em> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Comparison operator.
<p>
Compares to strings lexicographically. This may require evaluating a localized string in the current locale. The unicode representation of the strings are compared.
</div>
</div><p>
<a class="anchor" name="bb46a3098a1a185a3498fbcf4c714c7b"></a><!-- doxytag: member="Wt::WString::operator+=" ref="bb46a3098a1a185a3498fbcf4c714c7b" args="(const WString &rhs)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::operator+= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>rhs</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Self-concatenation operator.
<p>
Appends a string to the current value. If the string was localized, this automatically converts it to a literal string, by evaluating the string using the current locale.
</div>
</div><p>
<a class="anchor" name="0c455e324e5e756c456cd662f829373c"></a><!-- doxytag: member="Wt::WString::operator+=" ref="0c455e324e5e756c456cd662f829373c" args="(const std::wstring &rhs)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::operator+= </td>
<td>(</td>
<td class="paramtype">const std::wstring & </td>
<td class="paramname"> <em>rhs</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Self-concatenation operator.
<p>
Appends a string to the current value. If the string was localized, this automatically converts it to a literal string, by evaluating the string using the current locale.
</div>
</div><p>
<a class="anchor" name="64bbf435dfe82342ce43faf9c48ee28f"></a><!-- doxytag: member="Wt::WString::operator+=" ref="64bbf435dfe82342ce43faf9c48ee28f" args="(const wchar_t *rhs)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::operator+= </td>
<td>(</td>
<td class="paramtype">const wchar_t * </td>
<td class="paramname"> <em>rhs</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Self-concatenation operator.
<p>
Appends a string to the current value. If the string was localized, this automatically converts it to a literal string, by evaluating the string using the current locale.
</div>
</div><p>
<a class="anchor" name="36d097b2ed9a2e921ad2d6a79bc3dd25"></a><!-- doxytag: member="Wt::WString::operator+=" ref="36d097b2ed9a2e921ad2d6a79bc3dd25" args="(const std::string &rhs)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::operator+= </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>rhs</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Self-concatenation operator.
<p>
Appends a string to the current value. The right hand side is interpreted in the server locale and converted to unicode. If the string was localized, this automatically converts it to a literal string, by evaluating the string using the current locale.
</div>
</div><p>
<a class="anchor" name="cac4b0bc682e0789edc2976883ed7a5a"></a><!-- doxytag: member="Wt::WString::operator+=" ref="cac4b0bc682e0789edc2976883ed7a5a" args="(const char *rhs)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::operator+= </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>rhs</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Self-concatenation operator.
<p>
Appends a string to the current value. The right hand side is interpreted in the server locale and converted to unicode. If the string was localized, this automatically converts it to a literal string, by evaluating the string using the current locale.
</div>
</div><p>
<a class="anchor" name="17afc7c43b5b7a710047be4a2c639575"></a><!-- doxytag: member="Wt::WString::fromUTF8" ref="17afc7c43b5b7a710047be4a2c639575" args="(const std::string &value, bool checkValid=false)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> Wt::WString::fromUTF8 </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>checkValid</em> = <code>false</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a WString from a UTF8 unicode encoded string.
<p>
This is equivalent to using the constructor <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>(<code>value</code>, UTF8).<p>
When <code>checkValid</code> is <code>true</code>, the UTF8 encoding is validated. You should enable this only if you cannot trust the origin of the string. The library uses this internally whenever it receives data from the browser (in UTF-8 format).
</div>
</div><p>
<a class="anchor" name="4fbd5cdc92e39411de45acb680b1206b"></a><!-- doxytag: member="Wt::WString::fromUTF8" ref="4fbd5cdc92e39411de45acb680b1206b" args="(const char *value, bool checkValid=false)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> Wt::WString::fromUTF8 </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool </td>
<td class="paramname"> <em>checkValid</em> = <code>false</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a WString from a UTF8 unicode encoded string.
<p>
This is equivalent to using the constructor <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a>(<code>value</code>, UTF8).<p>
When <code>checkValid</code> is <code>true</code>, the UTF8 encoding is validated. You should enable this only if you cannot trust the origin of the string. The library uses this internally whenever it receives data from the browser (in UTF-8 format).
</div>
</div><p>
<a class="anchor" name="159d088da6e8f2be1035b2341889254c"></a><!-- doxytag: member="Wt::WString::toUTF8" ref="159d088da6e8f2be1035b2341889254c" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string Wt::WString::toUTF8 </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the value as a UTF8 unicode encoded string.
<p>
For a localized string, returns the current localized value.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WString.html#17afc7c43b5b7a710047be4a2c639575" title="Creates a WString from a UTF8 unicode encoded string.">fromUTF8()</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="0afc7dc0f9897456d71b569a86ca26c1"></a><!-- doxytag: member="Wt::WString::tr" ref="0afc7dc0f9897456d71b569a86ca26c1" args="(const char *key)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> Wt::WString::tr </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>key</em> </td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a localized string from a key.
<p>
Whenever the value of the string is needed, the key is used for a lookup in the application message resource bundles taking into account the current application locale. If the key cannot be resolved, its value is set to '??key??'.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WApplication.html#5386565e35a58c94ccbbfab48f2212a4" title="Returns the message resource bundle.">WApplication::messageResourceBundle()</a>, <a class="el" href="classWt_1_1WApplication.html#6e782f1f38a6f56e2024aab1a917a80b" title="Returns the current locale.">WApplication::locale()</a>, <a class="el" href="classWt_1_1WApplication.html#a140cb3c65451413939010d704e9a58a" title="Returns the resource object that provides localized strings.">WApplication::localizedStrings()</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="42a4aad50b5a1633b1cfef4c0ffa044a"></a><!-- doxytag: member="Wt::WString::tr" ref="42a4aad50b5a1633b1cfef4c0ffa044a" args="(const std::string &key)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> Wt::WString::tr </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>key</em> </td>
<td> ) </td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates a localized string with the specified key.
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WString.html#0afc7dc0f9897456d71b569a86ca26c1" title="Creates a localized string from a key.">tr(const char *)</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="b76d45947986f8aa20763cf99267ec23"></a><!-- doxytag: member="Wt::WString::value" ref="b76d45947986f8aa20763cf99267ec23" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::wstring Wt::WString::value </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the value as a wide C++ string.
<p>
A localized string is resolved using the <a class="el" href="classWt_1_1WApplication.html#a140cb3c65451413939010d704e9a58a" title="Returns the resource object that provides localized strings.">WApplication::localizedStrings()</a>.<p>
Argument place holders are substitued with actual arguments.
</div>
</div><p>
<a class="anchor" name="0b90340ac2dbacb9b4d81e92d9070066"></a><!-- doxytag: member="Wt::WString::narrow" ref="0b90340ac2dbacb9b4d81e92d9070066" args="(const std::locale &loc=std::locale()) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string Wt::WString::narrow </td>
<td>(</td>
<td class="paramtype">const std::locale & </td>
<td class="paramname"> <em>loc</em> = <code>std::locale()</code> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the value as a narrow C++ string.
<p>
A localized string is resolved using the <a class="el" href="classWt_1_1WApplication.html#a140cb3c65451413939010d704e9a58a" title="Returns the resource object that provides localized strings.">WApplication::localizedStrings()</a>.<p>
Argument place holders are substitued with actual arguments.<p>
Any wide character is narrowed using the provided locale, possibly losing information. If you wish to keep all information, use <a class="el" href="classWt_1_1WString.html#159d088da6e8f2be1035b2341889254c" title="Returns the value as a UTF8 unicode encoded string.">toUTF8()</a> instead, which encodes wide characters in the string.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WString.html#159d088da6e8f2be1035b2341889254c" title="Returns the value as a UTF8 unicode encoded string.">toUTF8()</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="af8a69faf2551af5afb4757fd02f631b"></a><!-- doxytag: member="Wt::WString::operator std::wstring" ref="af8a69faf2551af5afb4757fd02f631b" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Wt::WString::operator std::wstring </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the value as a wide C++ string.
<p>
A localized string is resolved using the <a class="el" href="classWt_1_1WApplication.html#a140cb3c65451413939010d704e9a58a" title="Returns the resource object that provides localized strings.">WApplication::localizedStrings()</a>.<p>
Argument place holders are substitued with actual arguments.
</div>
</div><p>
<a class="anchor" name="61a714a97bb6d70d60be6f9a1997e636"></a><!-- doxytag: member="Wt::WString::literal" ref="61a714a97bb6d70d60be6f9a1997e636" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Wt::WString::literal </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Retuns whether the string is literal or localized.
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WString.html#0afc7dc0f9897456d71b569a86ca26c1" title="Creates a localized string from a key.">tr()</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="18807776c41bdaebd7264bbabdd2282a"></a><!-- doxytag: member="Wt::WString::key" ref="18807776c41bdaebd7264bbabdd2282a" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const std::string Wt::WString::key </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the key for a localized string.
<p>
When the string is literal, the result is undefined.
</div>
</div><p>
<a class="anchor" name="1c3d0d7790282777ce13edececfe0095"></a><!-- doxytag: member="Wt::WString::arg" ref="1c3d0d7790282777ce13edececfe0095" args="(const std::wstring &value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::arg </td>
<td>(</td>
<td class="paramtype">const std::wstring & </td>
<td class="paramname"> <em>value</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Substitutes the next positional argument with a string value.
<p>
In the string, the <code>n-th</code> argument is referred to as using {<code>n}</code>.<p>
For example: the string "<code>{1} bought {2} apples in the shop.</code>" with first argument value "<code>Bart</code>" and second argument value <code>5</code> becomes: "<code>Bart bought 5 apples in the shop.</code>"
</div>
</div><p>
<a class="anchor" name="7da2111a8ca361ccd7d77df0232b3986"></a><!-- doxytag: member="Wt::WString::arg" ref="7da2111a8ca361ccd7d77df0232b3986" args="(const std::string &value, CharEncoding=LocalEncoding)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::arg </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>value</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classWt_1_1WString.html#55b820090cc9d15753301df90e35fd52">CharEncoding</a> </td>
<td class="paramname"> <em>encoding</em> = <code>LocalEncoding</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Substitutes the next positional argument with a string value.
<p>
In the string, the <code>n-th</code> argument is referred to as using {<code>n}</code>.<p>
For example: the string "<code>{1} bought {2} apples in the shop.</code>" with first argument value "<code>Bart</code>" and second argument value <code>5</code> becomes: "<code>Bart bought 5 apples in the shop.</code>"
</div>
</div><p>
<a class="anchor" name="4761af728bf3cc5bca4ae3770243883e"></a><!-- doxytag: member="Wt::WString::arg" ref="4761af728bf3cc5bca4ae3770243883e" args="(const WString &value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::arg </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>value</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Substitutes the next positional argument with a string value.
<p>
In the string, the <code>n-th</code> argument is referred to as using {<code>n}</code>.<p>
For example: the string "<code>{1} bought {2} apples in the shop.</code>" with first argument value "<code>Bart</code>" and second argument value <code>5</code> becomes: "<code>Bart bought 5 apples in the shop.</code>"
</div>
</div><p>
<a class="anchor" name="167d99295d497bc37c11893c175e7e02"></a><!-- doxytag: member="Wt::WString::arg" ref="167d99295d497bc37c11893c175e7e02" args="(int value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::arg </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>value</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Substitutes the next positional argument with an integer value.
<p>
In the string, the <code>n-th</code> argument is reffered to as using {<code>n}</code>.<p>
For example: the string "<code>{1} bought {2} apples in the shop.</code>" with first argument value "<code>Bart</code>" and second argument value <code>5</code> becomes: "<code>Bart bought 5 apples in the shop.</code>"
</div>
</div><p>
<a class="anchor" name="adfe619a23256dab80fd238c6e4ad7d7"></a><!-- doxytag: member="Wt::WString::arg" ref="adfe619a23256dab80fd238c6e4ad7d7" args="(double value)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classWt_1_1WString.html">WString</a> & Wt::WString::arg </td>
<td>(</td>
<td class="paramtype">double </td>
<td class="paramname"> <em>value</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Substitutes the next positional argument with a double value.
<p>
In the string, the <code>n-th</code> argument is reffered to as using {<code>n}</code>.<p>
For example: the string "<code>{1} bought {2} apples in the shop.</code>" with first argument value "<code>Bart</code>" and second argument value <code>5</code> becomes: "<code>Bart bought 5 apples in the shop.</code>"
</div>
</div><p>
<a class="anchor" name="59dcc59bd1bc95984f2add4e32e914c0"></a><!-- doxytag: member="Wt::WString::args" ref="59dcc59bd1bc95984f2add4e32e914c0" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const std::vector< std::string > & Wt::WString::args </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the list of arguments.
<p>
Each argument is UTF8 encoded.
</div>
</div><p>
<a class="anchor" name="545b18b7e07b4596281970ca1599430b"></a><!-- doxytag: member="Wt::WString::refresh" ref="545b18b7e07b4596281970ca1599430b" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Wt::WString::refresh </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Refreshes the string.
<p>
For a localized string, its value is resolved again.<p>
Returns whether the value has (potentially) changed.
</div>
</div><p>
<a class="anchor" name="bcdf277c20807ab963effd7e54732fa8"></a><!-- doxytag: member="Wt::WString::jsStringLiteral" ref="bcdf277c20807ab963effd7e54732fa8" args="(char delimiter= '\'') const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::string Wt::WString::jsStringLiteral </td>
<td>(</td>
<td class="paramtype">char </td>
<td class="paramname"> <em>delimiter</em> = <code>'\''</code> </td>
<td> ) </td>
<td> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the string as a JavaScript literal.
<p>
The <code>delimiter</code> may be a single or double quote.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WWebWidget.html#f9dc9dcb0eb0ba2d740645c9908694d0" title="Turn a UTF8 encoded string into a JavaScript string literal.">WWebWidget::jsStringLiteral()</a> </dd></dl>
</div>
</div><p>
<hr><h2>Friends And Related Function Documentation</h2>
<a class="anchor" name="55b820090cc9d15753301df90e35fd52"></a><!-- doxytag: member="Wt::WString::CharEncoding" ref="55b820090cc9d15753301df90e35fd52" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="classWt_1_1WString.html#55b820090cc9d15753301df90e35fd52">CharEncoding</a><code> [related]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Enumeration that indicates a character encoding.
<p>
Character encodings are used to represent characters in a stream of bytes. <dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="55b820090cc9d15753301df90e35fd52e31c944a7e88c44611f9317e7c1223e3"></a><!-- doxytag: member="LocalEncoding" ref="55b820090cc9d15753301df90e35fd52e31c944a7e88c44611f9317e7c1223e3" args="" -->LocalEncoding</em> </td><td>
Each byte represents a character, using the local server-side system locale. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="55b820090cc9d15753301df90e35fd5292c04a55980fec5344377e55b271cfd0"></a><!-- doxytag: member="UTF8" ref="55b820090cc9d15753301df90e35fd5292c04a55980fec5344377e55b271cfd0" args="" -->UTF8</em> </td><td>
The byte stream represents unicode characters encoded using UTF-8. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="552bc8e01a4bc1c6ba53607c414a82b7"></a><!-- doxytag: member="Wt::WString::WMessage" ref="552bc8e01a4bc1c6ba53607c414a82b7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="classWt_1_1WString.html">WString</a> <a class="el" href="classWt_1_1WString.html">WMessage</a><code> [related]</code> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Alias for WString (<b>deprecated</b>).
<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000019">Deprecated:</a></b></dt><dd>use <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a> instead.</dd></dl>
WString provides all the functionality of the now deprecated WMessage, but is used more consistently through the API.
</div>
</div><p>
<a class="anchor" name="5175831fb21a4e6245bfde54c5aaa3d2"></a><!-- doxytag: member="Wt::WString::operator<<" ref="5175831fb21a4e6245bfde54c5aaa3d2" args="(std::ostream &lhs, const WString &rhs)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">WT_API std::ostream & operator<< </td>
<td>(</td>
<td class="paramtype">std::ostream & </td>
<td class="paramname"> <em>lhs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classWt_1_1WString.html">WString</a> & </td>
<td class="paramname"> <em>rhs</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [related]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Output a <a class="el" href="classWt_1_1WString.html" title="A unicode string class, with support for localization.">WString</a> to a C++ stream.
<p>
The string is narrowed using the currently global C++ locale, possibly losing information.
</div>
</div><p>
<a class="anchor" name="0de7f8ee205f8a3368d6428e4b474f11"></a><!-- doxytag: member="Wt::WString::widen" ref="0de7f8ee205f8a3368d6428e4b474f11" args="(const std::string &s, const std::locale &loc=std::locale())" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">WT_API std::wstring widen </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::locale & </td>
<td class="paramname"> <em>loc</em> = <code>std::locale()</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [related]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Convert a narrow to a wide string.
<p>
Convert a narrow string to a wide string. This method will interpret the input string as being encoded in the given locale (by default the currently configured global C++ locale).<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd>narrow(const std::wstring&), <a class="el" href="classWt_1_1WString.html#a5e236feac365794b288fd04a461406b" title="Decode a UTF8 string a wide string.">fromUTF8(const std::string& s)</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="2986eba78638de302685abc4f8e694d0"></a><!-- doxytag: member="Wt::WString::narrow" ref="2986eba78638de302685abc4f8e694d0" args="(const std::wstring &s, const std::locale &loc=std::locale())" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">WT_API std::string narrow </td>
<td>(</td>
<td class="paramtype">const std::wstring & </td>
<td class="paramname"> <em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::locale & </td>
<td class="paramname"> <em>loc</em> = <code>std::locale()</code></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td><code> [related]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Convert a wide to a narrow string.
<p>
Convert a wide string to a narrow string. This method will encode the characters in the given locale, if possible.<p>
In general this will lead to a loss of information. If you wish to preserve all information, you should us <a class="el" href="classWt_1_1WString.html#159d088da6e8f2be1035b2341889254c" title="Returns the value as a UTF8 unicode encoded string.">toUTF8()</a> instead.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd>widen(const std::string&), <a class="el" href="classWt_1_1WString.html#32dae81c17e873b041a85a8509c905a5" title="Encode a wide string to UTF8.">toUTF8(const std::wstring& s)</a> </dd></dl>
</div>
</div><p>
<a class="anchor" name="a5e236feac365794b288fd04a461406b"></a><!-- doxytag: member="Wt::WString::fromUTF8" ref="a5e236feac365794b288fd04a461406b" args="(const std::string &s)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">WT_API std::wstring fromUTF8 </td>
<td>(</td>
<td class="paramtype">const std::string & </td>
<td class="paramname"> <em>s</em> </td>
<td> ) </td>
<td><code> [related]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Decode a UTF8 string a wide string.
<p>
Decode a UTF8 string to a wide string. In a UTF8 encoded unicode string, some unicode characters are represented in more than one byte. This method will decode to extract the proper unicode characters from the string. The resulting string may thus be shorter (has less characters) than the original, but does not lead to a loss of information.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd>toUTF8(const std::string& s), narrow(const std::wstring&) </dd></dl>
</div>
</div><p>
<a class="anchor" name="32dae81c17e873b041a85a8509c905a5"></a><!-- doxytag: member="Wt::WString::toUTF8" ref="32dae81c17e873b041a85a8509c905a5" args="(const std::wstring &s)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">WT_API std::string toUTF8 </td>
<td>(</td>
<td class="paramtype">const std::wstring & </td>
<td class="paramname"> <em>s</em> </td>
<td> ) </td>
<td><code> [related]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Encode a wide string to UTF8.
<p>
Convert a wide string to UTF8. This method will encode the given wide string in UTF8. This may result in a string that is possibly longer (has more characters), but does not lead to a loss of information.<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="classWt_1_1WString.html#a5e236feac365794b288fd04a461406b" title="Decode a UTF8 string a wide string.">fromUTF8(const std::string& s)</a>, narrow(const std::wstring&) </dd></dl>
</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:07 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>
|