Home | History | Annotate | Download | only in charset
      1 /**
      2 *******************************************************************************
      3 * Copyright (C) 2006-2007, International Business Machines Corporation and    *
      4 * others. All Rights Reserved.                                                *
      5 *******************************************************************************
      6 *
      7 *******************************************************************************
      8 */
      9 package com.ibm.icu.charset;
     10 
     11 final class UConverterStaticData {   /* +offset: size */
     12     int structSize;                /* +0: 4 Size of this structure */
     13 
     14     String name; /* +4: 60  internal name of the converter- invariant chars */
     15 
     16     int codepage;               /* +64: 4 codepage # (now IBM-$codepage) */
     17 
     18     byte platform;                /* +68: 1 platform of the converter (only IBM now) */
     19     byte conversionType;          /* +69: 1 conversion type */
     20 
     21     byte minBytesPerChar;         /* +70: 1 Minimum # bytes per char in this codepage */
     22     byte maxBytesPerChar;         /* +71: 1 Maximum # bytes output per UChar in this codepage */
     23 
     24     byte subChar[/*UCNV_MAX_SUBCHAR_LEN*/]; /* +72: 4  [note:  4 and 8 byte boundary] */
     25     byte subCharLen;              /* +76: 1 */
     26 
     27     byte hasToUnicodeFallback;   /* +77: 1 UBool needs to be changed to UBool to be consistent across platform */
     28     byte hasFromUnicodeFallback; /* +78: 1 */
     29     short unicodeMask;            /* +79: 1  bit 0: has supplementary  bit 1: has single surrogates */
     30     byte subChar1;               /* +80: 1  single-byte substitution character for IBM MBCS (0 if none) */
     31     byte reserved[/*19*/];           /* +81: 19 to round out the structure */
     32                                     /* total size: 100 */
     33     public UConverterStaticData()
     34     {
     35         subChar = new byte[UConverterConstants.MAX_SUBCHAR_LEN];
     36         reserved = new byte[19];
     37     }
     38 
     39 /*    public UConverterStaticData(int structSize_, String name_, int codepage_, byte platform_, byte conversionType_, byte minBytesPerChar_, byte maxBytesPerChar_, byte[] subChar_, byte subCharLen_, byte hasToUnicodeFallback_, byte hasFromUnicodeFallback_, short unicodeMask_, byte subChar1_, byte[] reserved_)
     40     {
     41         structSize = structSize_;
     42         name = name_;
     43         codepage = codepage_;
     44         platform = platform_;
     45         conversionType = conversionType_;
     46         minBytesPerChar = minBytesPerChar_;
     47         maxBytesPerChar = maxBytesPerChar_;
     48         subChar = new byte[UConverterConstants.MAX_SUBCHAR_LEN];
     49         System.arraycopy(subChar_, 0, subChar, 0, (subChar.length < subChar_.length? subChar.length : subChar_.length));
     50         subCharLen = subCharLen_;
     51         hasToUnicodeFallback = hasToUnicodeFallback_;
     52         hasFromUnicodeFallback = hasFromUnicodeFallback_;
     53         unicodeMask = unicodeMask_;
     54         subChar1 = subChar1_;
     55         reserved = new byte[19];
     56         System.arraycopy(reserved_, 0, reserved, 0, (reserved.length < reserved_.length? reserved.length : reserved_.length));
     57     }*/
     58 
     59     public static final int SIZE_OF_UCONVERTER_STATIC_DATA = 100;
     60 }
     61 
     62