1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined(__CONVDATA_H__)
17 #define __CONVDATA_H__
22 struct SCnvConversionData
24 /** Specifies the default endian-ness of the current character set. Used by SetDefaultEndiannessOfForeignCharacters(). */
25 enum TEndianness // the values of these *must not* change they are used hard-coded in CNVTOOL.PL
28 EFixedLittleEndian =1,
31 struct SVariableByteData
35 TUint8 iFirstInitialByteValueInRange;
36 TUint8 iLastInitialByteValueInRange;
37 TUint8 iNumberOfSubsequentBytes;
41 const SRange* iRangeArray;
43 struct SOneDirectionData
49 // each of these, with the exception of EDirect, has a corresponding member of UData
54 EKeyedTable16OfIndexedTables16
58 struct SIndexedTable16
62 TUint16 iOutputCharacterCode;
64 const SEntry* iEntryArray;
66 struct SKeyedTable1616
71 TUint16 iOutputCharacterCode;
73 TInt iNumberOfEntries;
74 const SEntry* iEntryArray;
76 struct SKeyedTable16OfIndexedTables16
80 TUint16 iFirstInputCharacterCodeInIndexedTable;
81 TUint16 iLastInputCharacterCodeInIndexedTable;
82 const TUint16* iIndexedEntryArray;
84 TInt iNumberOfKeyedEntries;
85 const SKeyedEntry* iKeyedEntryArray;
88 SIndexedTable16 iIndexedTable16;
89 SKeyedTable1616 iKeyedTable1616;
90 SKeyedTable16OfIndexedTables16 iKeyedTable16OfIndexedTables16;
92 TUint iFirstInputCharacterCodeInRange;
93 TUint iLastInputCharacterCodeInRange;
94 TUint8 iAlgorithm; // one of the TAlgorithm values
95 TUint8 iSizeOfOutputCharacterCodeInBytesIfForeign; // only used in SCnvConversionData::iUnicodeToForeignData
97 #if defined(CONST_STATIC_UNIONS_ARE_POSSIBLE)
107 TInt iNumberOfRanges;
108 const SRange* iRangeArray;
110 TEndianness iEndiannessOfForeignCharacters;
111 SVariableByteData iForeignVariableByteData;
112 SOneDirectionData iForeignToUnicodeData;
113 SOneDirectionData iUnicodeToForeignData;
114 TAny* iSpareForFutureUse_1;
115 TAny* iSpareForFutureUse_2;
121 #define UData_SIndexedTable16(a) \
122 reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SIndexedTable16::SEntry*>(a))
126 #define UData_SKeyedTable1616(a) \
127 static_cast<TUint>ARRAY_LENGTH(a), \
128 reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable1616::SEntry*>(a))
132 #define UData_SKeyedTable16OfIndexedTables16(a) \
133 static_cast<TUint>ARRAY_LENGTH(a), \
134 reinterpret_cast<TUint>(const_cast<SCnvConversionData::SOneDirectionData::SRange::UData::SKeyedTable16OfIndexedTables16::SKeyedEntry *>(a))