os/persistentdata/loggingservices/eventlogger/LogServ/inc/LogServResourceInterpreter.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) 2002-2010 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 //
    15 
    16 #ifndef __LOGSERVRESOURCEINTERPRETER_H__
    17 #define __LOGSERVRESOURCEINTERPRETER_H__
    18 
    19 #include <barsc.h>
    20 #include <barsread.h>
    21 #include <logcli.h>
    22 
    23 /**
    24 Gives an access to the LogWrap resource file and maintains a cache of the retrieved resource entries.
    25 
    26 @internalComponent
    27 */
    28 class CLogServResourceInterpreter : public CBase
    29 	{
    30 public:
    31 	static CLogServResourceInterpreter* NewL(RFs& aFs);
    32 	~CLogServResourceInterpreter();
    33     void CreateResourceReaderLC(TResourceReader& aReader, TInt aId);
    34 
    35 private:
    36     /**
    37     Resource file item.
    38     Holds one resource string identified by an id.
    39     @internalComponent
    40     */
    41 	struct TResourceString
    42 	    {
    43 		inline TResourceString(TInt aResourceId, HBufC8* aResourceString) :
    44 			iId(aResourceId),
    45 			iString(aResourceString)
    46 			{
    47 			}
    48 		TInt		iId;
    49 		HBufC8*		iString;
    50 	    };
    51 
    52     CLogServResourceInterpreter(RFs& aFs);
    53     void ConstructL();
    54 	HBufC8* GetStringL(TInt aId);
    55 	static TInt Compare(const TResourceString& aLeft, const TResourceString& aRight);
    56 		
    57 private:
    58 	RFs& 					iFs;
    59 	RResourceFile 			iFile;
    60 	RArray<TResourceString>	iStrings;
    61 	};
    62 
    63 #endif