sl@0: // Copyright (c) 1997-2009 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 "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: // The implementation of the accessor class for CResolver. sl@0: // sl@0: // sl@0: sl@0: // ______________________________________________________________________________ sl@0: // sl@0: _LIT(KTDefaultResolver_DumpName,"C:\\System\\Data\\Logs\\TDefaultResolver_StateDump.bin"); sl@0: sl@0: inline TInt TDefaultResolver_StateAccessor::InvariantTest(TAny* /*aTestObject*/) sl@0: { sl@0: // CDefaultResolver owns no data and contains no pointers so there is no invariant test sl@0: sl@0: return KErrNone; sl@0: } sl@0: sl@0: inline TInt TDefaultResolver_StateAccessor::Internalize(TAny* aTestObject) sl@0: { sl@0: TInt error = KErrNone; sl@0: if(aTestObject != NULL) sl@0: { sl@0: CDefaultResolver* DefaultResolver = REINTERPRET_CAST(CDefaultResolver*, aTestObject); sl@0: TRAP(error,InternalizeL(DefaultResolver)); sl@0: } sl@0: return error; sl@0: } sl@0: sl@0: inline TInt TDefaultResolver_StateAccessor::Externalize(TAny* aTestObject) sl@0: { sl@0: TInt error = KErrNone; sl@0: if(aTestObject != NULL) sl@0: { sl@0: CDefaultResolver* DefaultResolver = REINTERPRET_CAST(CDefaultResolver*, aTestObject); sl@0: TRAP(error,ExternalizeL(DefaultResolver)); sl@0: } sl@0: return error; sl@0: } sl@0: sl@0: inline void TDefaultResolver_StateAccessor::InternalizeL(RFileReadStream& /* aStream */, CDefaultResolver* /* aLoadManager */) sl@0: { sl@0: // Not required sl@0: } sl@0: sl@0: inline void TDefaultResolver_StateAccessor::ExternalizeL(RFileWriteStream& /* aStream */, CDefaultResolver* /* aLoadManager */) sl@0: { sl@0: // Not required sl@0: } sl@0: sl@0: // internal helpers sl@0: inline void TDefaultResolver_StateAccessor::InternalizeL(CDefaultResolver* aDefaultResolver) sl@0: { sl@0: // Read in the dumped data sl@0: RFs fs; sl@0: User::LeaveIfError(fs.Connect()); sl@0: CleanupClosePushL(fs); sl@0: // Read the object dump sl@0: TParse filename; sl@0: filename.Set(KTDefaultResolver_DumpName(),NULL,NULL); sl@0: RFileReadStream stream; sl@0: User::LeaveIfError(stream.Open(fs,filename.FullName(), EFileRead)); sl@0: CleanupClosePushL(stream); sl@0: InternalizeL(stream, aDefaultResolver); sl@0: CleanupStack::PopAndDestroy(); // stream sl@0: CleanupStack::PopAndDestroy(); // fs sl@0: } sl@0: sl@0: inline void TDefaultResolver_StateAccessor::ExternalizeL(CDefaultResolver* aDefaultResolver) sl@0: { sl@0: RFs fs; sl@0: User::LeaveIfError(fs.Connect()); sl@0: CleanupClosePushL(fs); sl@0: // Write out the object dump sl@0: TParse filename; sl@0: filename.Set(KTDefaultResolver_DumpName(),NULL,NULL); sl@0: RFileWriteStream stream; sl@0: User::LeaveIfError(stream.Replace(fs,filename.FullName(), EFileWrite)); sl@0: CleanupClosePushL(stream); sl@0: ExternalizeL(stream, aDefaultResolver); sl@0: CleanupStack::PopAndDestroy(); // stream sl@0: CleanupStack::PopAndDestroy(); // fs sl@0: } sl@0: sl@0: inline TBool TDefaultResolver_StateAccessor::Match(CDefaultResolver& aResolver, sl@0: const TDesC8& aImplementationType, sl@0: const TDesC8& aMatchType, sl@0: TBool aUseWildcards) const sl@0: { sl@0: return aResolver.Match(aImplementationType, aMatchType, aUseWildcards); sl@0: } sl@0: sl@0: inline TUid TDefaultResolver_StateAccessor::Resolve(CDefaultResolver& aResolver, sl@0: RImplInfoArray& aImplementationData, sl@0: const TEComResolverParams& aAdditionalParameters) const sl@0: { sl@0: return aResolver.Resolve(aImplementationData, aAdditionalParameters); sl@0: }