Update contrib.
2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: This file is a source code file for a charconv plug-in.
15 * This plug-in supports CP949.
23 #include <convgeneratedcpp.h>
24 #include <ecom/implementationproxy.h>
25 #include "cp949table.h"
26 #include "charactersetconverter.h"
27 // New Interface class
28 class CCP949Implementation : public CCharacterSetConverterPluginInterface
31 virtual const TDesC8& ReplacementForUnconvertibleUnicodeCharacters();
33 virtual TInt ConvertFromUnicode(
34 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
35 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
37 const TDesC16& aUnicode,
38 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters );
40 virtual TInt ConvertToUnicode(
41 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
43 const TDesC8& aForeign,
45 TInt& aNumberOfUnconvertibleCharacters,
46 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter );
48 virtual TBool IsInThisCharacterSetL(
50 TInt& aConfidenceLevel,
53 static CCP949Implementation* NewL();
55 virtual ~CCP949Implementation();
58 CCP949Implementation();
61 // FUNCTION DEFINITIONS
62 const TDesC8& CCP949Implementation::ReplacementForUnconvertibleUnicodeCharacters()
64 return CnvCp949Table::ReplacementForUnconvertibleUnicodeCharacters();
67 TInt CCP949Implementation::ConvertFromUnicode(
68 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
69 const TDesC8& aReplacementForUnconvertibleUnicodeCharacters,
71 const TDesC16& aUnicode,
72 CCnvCharacterSetConverter::TArrayOfAscendingIndices& aIndicesOfUnconvertibleCharacters)
74 return CCnvCharacterSetConverter::DoConvertFromUnicode(CnvCp949Table::ConversionData(), aDefaultEndiannessOfForeignCharacters, aReplacementForUnconvertibleUnicodeCharacters, aForeign, aUnicode, aIndicesOfUnconvertibleCharacters);
77 TInt CCP949Implementation::ConvertToUnicode(
78 CCnvCharacterSetConverter::TEndianness aDefaultEndiannessOfForeignCharacters,
80 const TDesC8& aForeign,
82 TInt& aNumberOfUnconvertibleCharacters,
83 TInt& aIndexOfFirstByteOfFirstUnconvertibleCharacter)
85 return CCnvCharacterSetConverter::DoConvertToUnicode(CnvCp949Table::ConversionData(), aDefaultEndiannessOfForeignCharacters, aUnicode, aForeign, aNumberOfUnconvertibleCharacters, aIndexOfFirstByteOfFirstUnconvertibleCharacter);
89 TBool CCP949Implementation::IsInThisCharacterSetL(
91 TInt& aConfidenceLevel,
92 const TDesC8& /*aBuf*/)
99 for (TInt i=0;i<aBuf.Length();i++)
106 else if (0xa1<=ch&&ch<=0xfe)
109 __ASSERT_DEBUG(i<aBuf.Length(),User::Panic(_L("CP949"),__LINE__));
125 CCP949Implementation* CCP949Implementation::NewL()
127 CCP949Implementation* self = new(ELeave) CCP949Implementation;
131 CCP949Implementation::CCP949Implementation()
133 //default constructor.. do nothing
136 CCP949Implementation::~CCP949Implementation()
138 //default destructor .. do nothing
141 // ECOM CREATION FUNCTION
142 const TImplementationProxy ImplementationTable[] =
144 // Note: This is the same UID as defined in old mmp-file
145 // Used also in 12221212.rss ( implementation_uid )
146 IMPLEMENTATION_PROXY_ENTRY( 0x200100FF, CCP949Implementation::NewL )
149 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
151 aTableCount = sizeof( ImplementationTable ) / sizeof(TImplementationProxy);
152 return ImplementationTable;