#include <Charset.h>
Definition at line 366 of file Charset.h.
◆ LocaleEncoder()
LocaleEncoder::LocaleEncoder |
( |
| ) |
|
◆ encode() [1/3]
ByteString LocaleEncoder::encode |
( |
const String & | _str | ) |
|
|
inlinestatic |
Definition at line 388 of file Charset.h.
390 {
392 }
virtual int encode(const wchar_t *_in, size_t &_inCount, byte_t *_out, size_t &_outCount)
◆ encode() [2/3]
int LocaleEncoder::encode |
( |
const wchar_t * | _in, |
|
|
size_t & | _inCount, |
|
|
byte_t * | _out, |
|
|
size_t & | _outCount ) |
|
virtual |
Definition at line 497 of file CharsetEncoder.cpp.
503{
505
507 byte_t* dstend = dst + _outCount;
508 size_t dstlen;
509
510 const wchar_t* src = _in;
511 const wchar_t* srcend = src + _inCount;
512
514 char aBuf[24];
515 while (src < srcend && (dstlen = dstend - dst) > 0) {
516 n = wcrtomb(aBuf, *src, &__mbstate);
517 if (
n == (
size_t) -1 ||
n > dstlen)
518
519 break;
520
521 strncpy((
char*)dst, aBuf,
n);
522
524 src++;
525 }
526
527 _inCount = src - _in;
528 _outCount = dst - _out;
529
530 if (
n == (
size_t) -1)
532
533
534
535
537}
#define __DCL_ASSERT(expr)
void CharsetConvertException *size_t n
◆ encode() [3/3]
ByteString LocaleEncoder::encode |
( |
const wchar_t * | _wcs, |
|
|
size_t | _wcslen ) |
|
inlinestatic |
◆ reset()
void LocaleEncoder::reset |
( |
| ) |
|
|
virtual |
Definition at line 491 of file CharsetEncoder.cpp.
492{
493 memset(&__mbstate, 0, sizeof(__mbstate));
494}
◆ toMultiByte()
int LocaleEncoder::toMultiByte |
( |
ucs4_t | _uc, |
|
|
byte_t * | _mbs, |
|
|
size_t | _mbslen ) |
|
protectedvirtual |
The documentation for this class was generated from the following files: