os/persistentdata/persistentstorage/dbms/security/SC_DomainLoader.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2004-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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // CPolicyDomainLoader class
    15 // 
    16 //
    17 
    18 #ifndef __SC_DOMAINLOADER_H__
    19 #define __SC_DOMAINLOADER_H__
    20 
    21 #include <e32base.h>
    22 #include "D32Map.h"
    23 #include "SC_Policy.h"
    24 
    25 namespace DBSC
    26 {
    27 
    28 /**
    29 CPolicyDomainLoader is a special policy file loader.
    30 The "special" thing is that it will trap all errors during processing of
    31 the binary policy files. If there is an error, the loader will check it
    32 anld leave if it is KErrNoMemory. The rest of errors, which are caused by
    33 things such as file system problems, hardware problems and binary policy file problems 
    34 (bad format, bad names,...), will be supressed.
    35 @internalComponent
    36 */
    37 NONSHARABLE_CLASS(CPolicyDomainLoader) : public CBase
    38 	{
    39 public:
    40 	static CPolicyDomainLoader* NewLC(RFs& aFs, const TDesC& aPolicyDir, 
    41 									  RMap<TInt,CPolicyDomain*>& aPDCollection);
    42 	virtual ~CPolicyDomainLoader();
    43 	void RunL();
    44 
    45 private:
    46 	inline CPolicyDomainLoader(RFs& aFs, const TDesC& aPolicyDir, 
    47 							   RMap<TInt,CPolicyDomain*>& aPDCollection);
    48 	void ConstructL();
    49 	void CreatePolicyDomainL(TInt aPolicyFileIndex);
    50 	void DoCreatePolicyDomainL(TInt aPolicyFileIndex);
    51 	TUid CreatePolicyFilePathL(TInt aPolicyFileIndex);
    52 
    53 private:
    54 	RFs&						iFs;
    55 	const TDesC&				iPolicyDir;
    56 	RMap<TInt, CPolicyDomain*>&	iPDCollection;
    57 	CDir*						iFoundPolicyFiles;
    58 	TParse						iParser;
    59 	TBuf<KMaxPath>				iPolicyFilePath;
    60 
    61 	};
    62 
    63 } //end of - namespace DBSC
    64 
    65 #endif//__SC_DOMAINLOADER_H__