sl@0: /* sl@0: * Copyright (c) 2002-2008 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: // INCLUDE FILES sl@0: #include sl@0: #include "SortUtil.h" sl@0: sl@0: #ifdef __WINS__ sl@0: #include sl@0: #ifndef KFeatureIdJapanese sl@0: #define KFeatureIdJapanese 1080 sl@0: #endif sl@0: #endif sl@0: sl@0: // LOCAL CONSTANTS AND MACROS sl@0: typedef MSortUtil* (*TSortUtilFactoryFunctionL)(); sl@0: _LIT( KSortUtilImpl, "SortUtilImpl.dll" ); sl@0: #ifdef __WINS__ sl@0: _LIT( KSortUtilImplJapan, "SortUtilImplJapan.dll" ); sl@0: _LIT( KSortUtilImplKorean, "SortUtilImplKorean.dll" ); sl@0: #endif // __WINS__ sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSortUtil::NewL() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C CSortUtil* CSortUtil::NewL() sl@0: { sl@0: CSortUtil* self = new( ELeave ) CSortUtil; sl@0: CleanupStack::PushL( self ); sl@0: self->ConstructL(); sl@0: CleanupStack::Pop(); sl@0: return self; sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSortUtil::~CSortUtil() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: CSortUtil::~CSortUtil() sl@0: { sl@0: delete iInterface; sl@0: iLib.Close(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSortUtil::CSortUtil() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: CSortUtil::CSortUtil() sl@0: { sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // CSortUtil::ConstructL() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: void CSortUtil::ConstructL() sl@0: { sl@0: #ifdef __WINS__ sl@0: FeatureManager::InitializeLibL(); sl@0: if ( FeatureManager::FeatureSupported( KFeatureIdJapanese ) ) sl@0: { sl@0: // load polymorphic implementation DLL sl@0: User::LeaveIfError( iLib.Load( KSortUtilImplJapan ) ); sl@0: } sl@0: #ifdef __KOREAN_SORT__ sl@0: else sl@0: { sl@0: // load polymorphic implementation DLL sl@0: User::LeaveIfError( iLib.Load( KSortUtilImplKorean ) ); sl@0: } sl@0: #else sl@0: else sl@0: { sl@0: // load polymorphic implementation DLL sl@0: User::LeaveIfError( iLib.Load( KSortUtilImpl ) ); sl@0: } sl@0: #endif sl@0: FeatureManager::UnInitializeLib(); sl@0: #else sl@0: sl@0: // load polymorphic implementation DLL sl@0: User::LeaveIfError( iLib.Load( KSortUtilImpl ) ); sl@0: sl@0: #endif // __WINS__ sl@0: sl@0: iInterface = ( *(TSortUtilFactoryFunctionL)iLib.Lookup( 1 ) )(); sl@0: User::LeaveIfNull( iInterface ); sl@0: } sl@0: sl@0: // End of File