sl@0: // Copyright (c) 2005-2010 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: // sl@0: sl@0: #ifndef t_logsecuritypolicy_h sl@0: #define t_logsecuritypolicy_h sl@0: sl@0: #include sl@0: sl@0: /** sl@0: TCompiledSecurityPolicy is a test class used for accessing private data members sl@0: of TSecurityPolicy class. It uses the fact that TSecurityPolicy class has a friend class, sl@0: which name is TCompiledSecurityPolicy. sl@0: @internalComponent sl@0: */ sl@0: class TCompiledSecurityPolicy sl@0: { sl@0: public: sl@0: TCompiledSecurityPolicy(const TSecurityPolicy& aSecurityPolicy) : sl@0: iSecurityPolicy(aSecurityPolicy) sl@0: { sl@0: } sl@0: TSecurityPolicy::TType Type() const sl@0: { sl@0: return static_cast (iSecurityPolicy.iType); sl@0: } sl@0: TUint32 SecureId() const sl@0: { sl@0: return iSecurityPolicy.iSecureId; sl@0: } sl@0: TUint32 VendorId() const sl@0: { sl@0: return iSecurityPolicy.iVendorId; sl@0: } sl@0: TCapability Capability(TInt aIndex) const sl@0: { sl@0: if(aIndex < 3) sl@0: { sl@0: return static_cast (iSecurityPolicy.iCaps[aIndex]); sl@0: } sl@0: else if(aIndex < 7) sl@0: { sl@0: return static_cast (iSecurityPolicy.iExtraCaps[aIndex - 3]); sl@0: } sl@0: User::Invariant(); sl@0: return ECapability_None; sl@0: } sl@0: sl@0: private: sl@0: const TSecurityPolicy& iSecurityPolicy; sl@0: sl@0: }; sl@0: sl@0: inline TBool operator==(const TCompiledSecurityPolicy& aLeft, const TCompiledSecurityPolicy& aRight) sl@0: { sl@0: return aLeft.Type() == aRight.Type() && sl@0: aLeft.SecureId() == aRight.SecureId() && sl@0: aLeft.VendorId() == aRight.VendorId() && sl@0: aLeft.Capability(0) == aRight.Capability(0) && sl@0: aLeft.Capability(1) == aRight.Capability(1) && sl@0: aLeft.Capability(2) == aRight.Capability(2) && sl@0: aLeft.Capability(3) == aRight.Capability(3) && sl@0: aLeft.Capability(4) == aRight.Capability(4) && sl@0: aLeft.Capability(5) == aRight.Capability(5) && sl@0: aLeft.Capability(6) == aRight.Capability(6); sl@0: } sl@0: sl@0: #endif//t_logsecuritypolicy_h