DCL 4.0
Loading...
Searching...
No Matches
UTF32Encoder Class Reference

#include <Charset.h>

Inheritance diagram for UTF32Encoder:
CharsetEncoder Object

Protected Member Functions

virtual int toMultiByte (ucs4_t _uc, byte_t *_mbs, size_t _mbslen)
Protected Member Functions inherited from CharsetEncoder
 CharsetEncoder ()
Protected Member Functions inherited from Object
virtual ~Object ()
 Object ()

Additional Inherited Members

Public Member Functions inherited from Object
virtual String toString () const
virtual void destroy ()
String className () const
bool isInstanceOf (const std::type_info &typeinfo) const
virtual const std::type_info & typeInfo () const

Detailed Description

Definition at line 255 of file Charset.h.

Member Function Documentation

◆ toMultiByte()

int UTF32Encoder::toMultiByte ( ucs4_t _uc,
byte_t * _mbs,
size_t _mbslen )
protectedvirtual

Implements CharsetEncoder.

Definition at line 427 of file CharsetEncoder.cpp.

428{
429 if (_uc < 0x110000 && !(_uc >= 0xd800 && _uc < 0xe000)) {
430 int count = 0;
431 if (_uc < 0x110000) {
432 if (_mbslen >= 4) {
433 if (__bigEndian) {
434 _mbs[0] = 0;
435 _mbs[1] = (unsigned char) (_uc >> 16);
436 _mbs[2] = (unsigned char) (_uc >> 8);
437 _mbs[3] = (unsigned char) _uc;
438 }
439 else {
440 _mbs[3] = 0;
441 _mbs[2] = (unsigned char) (_uc >> 16);
442 _mbs[1] = (unsigned char) (_uc >> 8);
443 _mbs[0] = (unsigned char) _uc;
444 }
445 return count + 4;
446 }
447 else
448 return BUFFER_SMALL;
449 }
450 }
451 return ILLEGAL_UCS4;
452}
#define ILLEGAL_UCS4
#define BUFFER_SMALL

The documentation for this class was generated from the following files: