os/ossrv/lowlevellibsandfws/pluginfw/Framework/ResolverTest/ResolverStateAccessor.inl
First public contribution.
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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // The implementation of the accessor class for CResolver.
18 // ______________________________________________________________________________
20 _LIT(KTDefaultResolver_DumpName,"C:\\System\\Data\\Logs\\TDefaultResolver_StateDump.bin");
22 inline TInt TDefaultResolver_StateAccessor::InvariantTest(TAny* /*aTestObject*/)
24 // CDefaultResolver owns no data and contains no pointers so there is no invariant test
29 inline TInt TDefaultResolver_StateAccessor::Internalize(TAny* aTestObject)
31 TInt error = KErrNone;
32 if(aTestObject != NULL)
34 CDefaultResolver* DefaultResolver = REINTERPRET_CAST(CDefaultResolver*, aTestObject);
35 TRAP(error,InternalizeL(DefaultResolver));
40 inline TInt TDefaultResolver_StateAccessor::Externalize(TAny* aTestObject)
42 TInt error = KErrNone;
43 if(aTestObject != NULL)
45 CDefaultResolver* DefaultResolver = REINTERPRET_CAST(CDefaultResolver*, aTestObject);
46 TRAP(error,ExternalizeL(DefaultResolver));
51 inline void TDefaultResolver_StateAccessor::InternalizeL(RFileReadStream& /* aStream */, CDefaultResolver* /* aLoadManager */)
56 inline void TDefaultResolver_StateAccessor::ExternalizeL(RFileWriteStream& /* aStream */, CDefaultResolver* /* aLoadManager */)
62 inline void TDefaultResolver_StateAccessor::InternalizeL(CDefaultResolver* aDefaultResolver)
64 // Read in the dumped data
66 User::LeaveIfError(fs.Connect());
67 CleanupClosePushL(fs);
68 // Read the object dump
70 filename.Set(KTDefaultResolver_DumpName(),NULL,NULL);
71 RFileReadStream stream;
72 User::LeaveIfError(stream.Open(fs,filename.FullName(), EFileRead));
73 CleanupClosePushL(stream);
74 InternalizeL(stream, aDefaultResolver);
75 CleanupStack::PopAndDestroy(); // stream
76 CleanupStack::PopAndDestroy(); // fs
79 inline void TDefaultResolver_StateAccessor::ExternalizeL(CDefaultResolver* aDefaultResolver)
82 User::LeaveIfError(fs.Connect());
83 CleanupClosePushL(fs);
84 // Write out the object dump
86 filename.Set(KTDefaultResolver_DumpName(),NULL,NULL);
87 RFileWriteStream stream;
88 User::LeaveIfError(stream.Replace(fs,filename.FullName(), EFileWrite));
89 CleanupClosePushL(stream);
90 ExternalizeL(stream, aDefaultResolver);
91 CleanupStack::PopAndDestroy(); // stream
92 CleanupStack::PopAndDestroy(); // fs
95 inline TBool TDefaultResolver_StateAccessor::Match(CDefaultResolver& aResolver,
96 const TDesC8& aImplementationType,
97 const TDesC8& aMatchType,
98 TBool aUseWildcards) const
100 return aResolver.Match(aImplementationType, aMatchType, aUseWildcards);
103 inline TUid TDefaultResolver_StateAccessor::Resolve(CDefaultResolver& aResolver,
104 RImplInfoArray& aImplementationData,
105 const TEComResolverParams& aAdditionalParameters) const
107 return aResolver.Resolve(aImplementationData, aAdditionalParameters);