os/persistentdata/loggingservices/eventlogger/LogWrap/src/LOGBASE.CPP
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/loggingservices/eventlogger/LogWrap/src/LOGBASE.CPP	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,149 @@
     1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#include <bautils.h>
    1.20 +
    1.21 +#include <logwrap.h>
    1.22 +#include "LOGPANIC.H"
    1.23 +
    1.24 +_LIT(KLogResourceFile,"\\resource\\logeng\\logwrap.rsc");
    1.25 +
    1.26 +/** Sets the priority of this active object.
    1.27 +
    1.28 +@param aPriority The priority of this active object. */
    1.29 +EXPORT_C CLogBase::CLogBase(TInt aPriority)
    1.30 +: CLogActive(aPriority), iResourceFile(NULL)
    1.31 +	{
    1.32 +	}
    1.33 +
    1.34 +/** Fees all resources owned by the object prior to its destruction. In particular 
    1.35 +it closes the resource file reader. */
    1.36 +EXPORT_C CLogBase::~CLogBase()
    1.37 +	{
    1.38 +	  delete iResourceFile;
    1.39 +	}
    1.40 +
    1.41 +#pragma BullseyeCoverage off
    1.42 +
    1.43 +/** Adds an event to the log database. This is an asynchronous request.
    1.44 +	
    1.45 +	This function is overridden by log engine implementations.
    1.46 +	
    1.47 +	@param aEvent A reference to a log event detail object. This value is not 
    1.48 +	used.
    1.49 +	@param aStatus The request status. On completion of the asynchronous request, 
    1.50 +	it always contains KErrNotSupported.
    1.51 +	@capability Note For built-in event types, the required capability level is defined in
    1.52 +	the event type's write access policy. */
    1.53 +EXPORT_C void CLogBase::AddEvent(CLogEvent&, TRequestStatus& aStatus)
    1.54 +	{
    1.55 +	TRequestStatus* st = &aStatus;
    1.56 +	User::RequestComplete(st, KErrNotSupported);
    1.57 +	}
    1.58 +
    1.59 +/** Gets the details of an existing event. This is an asynchronous request.
    1.60 +	
    1.61 +	This function is overridden by log engine implementations.
    1.62 +	
    1.63 +	@param aEvent A reference to a log event detail object. This value is not 
    1.64 +	used.
    1.65 +	@param aStatus The request status. On completion of the asynchronous request, 
    1.66 +	it always contains KErrNotSupported.
    1.67 +	@capability Note For built-in event types, the required capability level is defined in
    1.68 +	the event type's read access policy. */
    1.69 +EXPORT_C void CLogBase::GetEvent(CLogEvent&, TRequestStatus& aStatus)
    1.70 +	{
    1.71 +	TRequestStatus* st = &aStatus;
    1.72 +	User::RequestComplete(st, KErrNotSupported);
    1.73 +	}
    1.74 +
    1.75 +/** Changes the details of an existing event. This is an asynchronous request.
    1.76 +	
    1.77 +	This function is overridden by log engine implementations.
    1.78 +	
    1.79 +	@param aEvent A reference to a log event detail object. This value is not 
    1.80 +	used.
    1.81 +	@param aStatus The request status. On completion of the asynchronous request, 
    1.82 +	it always contains KErrNotSupported.
    1.83 +	@capability Note For built-in event types, the required capability level is defined in
    1.84 +	the event type's write access policy. */
    1.85 +EXPORT_C void CLogBase::ChangeEvent(const CLogEvent&, TRequestStatus& aStatus)
    1.86 +	{
    1.87 +	TRequestStatus* st = &aStatus;
    1.88 +	User::RequestComplete(st, KErrNotSupported);
    1.89 +	}
    1.90 +
    1.91 +/** Deletes an event from the log. This is an asynchronous request. 
    1.92 +	
    1.93 +	This function is overridden by log engine implementations.
    1.94 +	
    1.95 +	@param aId The unique event ID of the event to be deleted. This value is not 
    1.96 +	used.
    1.97 +	@param aStatus The request status. On completion of the asynchronous request, 
    1.98 +	it always contains KErrNotSupported..
    1.99 +	@capability Note For built-in event types, the required capability level is defined in
   1.100 +	the event type's write access policy. */
   1.101 +EXPORT_C void CLogBase::DeleteEvent(TLogId, TRequestStatus& aStatus)
   1.102 +	{
   1.103 +	TRequestStatus* st = &aStatus;
   1.104 +	User::RequestComplete(st, KErrNotSupported);
   1.105 +	}
   1.106 +
   1.107 +/** Gets a standard string from the logwrap.dll resource file.
   1.108 +	
   1.109 +	This function is overridden by log engine implementations.
   1.110 +	
   1.111 +	@param aString A modifiable descriptor. The length of this descriptor is set 
   1.112 +	to zero.
   1.113 +	@param aId The resource ID for the string. This value is not used.
   1.114 +	@return KErrNotSupported.
   1.115 +	@see RResourceFile */
   1.116 +EXPORT_C TInt CLogBase::GetString(TDes& aString, TInt) const
   1.117 +	{
   1.118 +	aString.Zero();
   1.119 +	return KErrNotSupported;
   1.120 +	}
   1.121 +
   1.122 +void CLogBase::DoRunL()
   1.123 +	{
   1.124 +	__ASSERT_DEBUG(ETrue, Panic(ELogNotImplemented));
   1.125 +	}
   1.126 +
   1.127 +#pragma BullseyeCoverage on
   1.128 +
   1.129 +EXPORT_C void CLogBase::LoadResourcesL(RFs& aFs)
   1.130 +	{
   1.131 +	// Find the resource file
   1.132 +    TFileName fileName;
   1.133 +    Dll::FileName(fileName);
   1.134 +
   1.135 +    TParse parse;
   1.136 +    parse.Set(KLogResourceFile, &fileName, NULL);
   1.137 +	fileName = parse.FullName();
   1.138 +
   1.139 +	// Get language of resource file
   1.140 +	BaflUtils::NearestLanguageFile(aFs, fileName);
   1.141 +
   1.142 +	// Creating resource file member with 0 offset and 0 section size
   1.143 +	iResourceFile = CResourceFile::NewL(aFs, fileName, 0, 0);  
   1.144 +	}
   1.145 +
   1.146 +#pragma BullseyeCoverage off
   1.147 +
   1.148 +EXPORT_C void CLogBase::CLogBase_Reserved1()
   1.149 +	{
   1.150 +	}
   1.151 +
   1.152 +#pragma BullseyeCoverage on