DCL 4.0
Loading...
Searching...
No Matches
CharsetDecoder.cpp File Reference
#include <dcl/Config.h>
#include <string.h>
#include <wchar.h>
#include <dcl/Charset.h>

Go to the source code of this file.

Macros

#define ILLEGAL_UCS2   -1
#define ILLEGAL_SEQUENCE   -2
#define SOURCE_FEW   -3
#define SOURCE_FEW_N(_mbslen)

Functions

 IMPLEMENT_CLASSINFO (CharsetDecoder, Object) CharsetDecoder
 IMPLEMENT_CLASSINFO (UTF8Decoder, CharsetDecoder) UTF8Decoder
 IMPLEMENT_CLASSINFO (UTF16Decoder, CharsetDecoder) UTF16Decoder
 IMPLEMENT_CLASSINFO (UTF32Decoder, CharsetDecoder) UTF32Decoder
 IMPLEMENT_CLASSINFO (AsciiDecoder, CharsetEncoder) AsciiDecoder
 IMPLEMENT_CLASSINFO (Latin1Decoder, CharsetEncoder) Latin1Decoder
 IMPLEMENT_CLASSINFO (LocaleDecoder, CharsetDecoder) LocaleDecoder

Macro Definition Documentation

◆ ILLEGAL_SEQUENCE

#define ILLEGAL_SEQUENCE   -2

Definition at line 24 of file CharsetDecoder.cpp.

◆ ILLEGAL_UCS2

#define ILLEGAL_UCS2   -1

Definition at line 23 of file CharsetDecoder.cpp.

◆ SOURCE_FEW

#define SOURCE_FEW   -3

Definition at line 25 of file CharsetDecoder.cpp.

◆ SOURCE_FEW_N

#define SOURCE_FEW_N ( _mbslen)
Value:
(-3-(_mbslen))

Definition at line 26 of file CharsetDecoder.cpp.

Function Documentation

◆ IMPLEMENT_CLASSINFO() [1/7]

IMPLEMENT_CLASSINFO ( AsciiDecoder ,
CharsetEncoder  )

Definition at line 385 of file CharsetDecoder.cpp.

388{
389}

◆ IMPLEMENT_CLASSINFO() [2/7]

IMPLEMENT_CLASSINFO ( CharsetDecoder ,
Object  )

Definition at line 28 of file CharsetDecoder.cpp.

31{
32#if __DCL_DEBUG
33 __DCL_ASSERT(sizeof(ucs4_t) == 4);
34#if __SIZEOF_WCHAR_T__ == 4
35 __DCL_ASSERT(sizeof(wchar_t) == 4);
36#endif
37#if __SIZEOF_WCHAR_T__ == 2
38 __DCL_ASSERT(sizeof(wchar_t) == 2);
39#endif
40 ucs4_t uc = 0x31323334;
41#if __BYTE_ORDER == __BIG_ENDIAN
42 __DCL_ASSERT(memcmp(&uc, "1234", sizeof(uc)) == 0);
43#else
44 __DCL_ASSERT(memcmp(&uc, "4321", sizeof(uc)) == 0);
45#endif
46#endif
47
48}
__DCL_BEGIN_NAMESPACE typedef uint32_t ucs4_t
Definition Charset.h:29
#define __DCL_ASSERT(expr)
Definition Object.h:371

◆ IMPLEMENT_CLASSINFO() [3/7]

IMPLEMENT_CLASSINFO ( Latin1Decoder ,
CharsetEncoder  )

Definition at line 420 of file CharsetDecoder.cpp.

423{
424}

◆ IMPLEMENT_CLASSINFO() [4/7]

IMPLEMENT_CLASSINFO ( LocaleDecoder ,
CharsetDecoder  )

Definition at line 451 of file CharsetDecoder.cpp.

454{
455 reset();
456}

◆ IMPLEMENT_CLASSINFO() [5/7]

IMPLEMENT_CLASSINFO ( UTF16Decoder ,
CharsetDecoder  )

Definition at line 284 of file CharsetDecoder.cpp.

289{
290 __DCL_ASSERT(nDefaultByteOrder == CS_LITTLE_ENDIAN
291 || nDefaultByteOrder == CS_BIG_ENDIAN);
292
293 __defaultBigEndian = nDefaultByteOrder == CS_BIG_ENDIAN;
294 reset();
295}
@ CS_BIG_ENDIAN
Definition Charset.h:57
@ CS_LITTLE_ENDIAN
Definition Charset.h:56

◆ IMPLEMENT_CLASSINFO() [6/7]

IMPLEMENT_CLASSINFO ( UTF32Decoder ,
CharsetDecoder  )

Definition at line 338 of file CharsetDecoder.cpp.

343{
344 __DCL_ASSERT(nDefaultByteOrder == CS_LITTLE_ENDIAN
345 || nDefaultByteOrder == CS_BIG_ENDIAN);
346
347 __defaultBigEndian = nDefaultByteOrder == CS_BIG_ENDIAN;
348}

◆ IMPLEMENT_CLASSINFO() [7/7]

IMPLEMENT_CLASSINFO ( UTF8Decoder ,
CharsetDecoder  )

Definition at line 168 of file CharsetDecoder.cpp.

171{
172 reset();
173}