os/persistentdata/loggingservices/eventlogger/LogWrap/src/LOGBASE.CPP
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2002-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 //
    15 
    16 #include <bautils.h>
    17 
    18 #include <logwrap.h>
    19 #include "LOGPANIC.H"
    20 
    21 _LIT(KLogResourceFile,"\\resource\\logeng\\logwrap.rsc");
    22 
    23 /** Sets the priority of this active object.
    24 
    25 @param aPriority The priority of this active object. */
    26 EXPORT_C CLogBase::CLogBase(TInt aPriority)
    27 : CLogActive(aPriority), iResourceFile(NULL)
    28 	{
    29 	}
    30 
    31 /** Fees all resources owned by the object prior to its destruction. In particular 
    32 it closes the resource file reader. */
    33 EXPORT_C CLogBase::~CLogBase()
    34 	{
    35 	  delete iResourceFile;
    36 	}
    37 
    38 #pragma BullseyeCoverage off
    39 
    40 /** Adds an event to the log database. This is an asynchronous request.
    41 	
    42 	This function is overridden by log engine implementations.
    43 	
    44 	@param aEvent A reference to a log event detail object. This value is not 
    45 	used.
    46 	@param aStatus The request status. On completion of the asynchronous request, 
    47 	it always contains KErrNotSupported.
    48 	@capability Note For built-in event types, the required capability level is defined in
    49 	the event type's write access policy. */
    50 EXPORT_C void CLogBase::AddEvent(CLogEvent&, TRequestStatus& aStatus)
    51 	{
    52 	TRequestStatus* st = &aStatus;
    53 	User::RequestComplete(st, KErrNotSupported);
    54 	}
    55 
    56 /** Gets the details of an existing event. This is an asynchronous request.
    57 	
    58 	This function is overridden by log engine implementations.
    59 	
    60 	@param aEvent A reference to a log event detail object. This value is not 
    61 	used.
    62 	@param aStatus The request status. On completion of the asynchronous request, 
    63 	it always contains KErrNotSupported.
    64 	@capability Note For built-in event types, the required capability level is defined in
    65 	the event type's read access policy. */
    66 EXPORT_C void CLogBase::GetEvent(CLogEvent&, TRequestStatus& aStatus)
    67 	{
    68 	TRequestStatus* st = &aStatus;
    69 	User::RequestComplete(st, KErrNotSupported);
    70 	}
    71 
    72 /** Changes the details of an existing event. This is an asynchronous request.
    73 	
    74 	This function is overridden by log engine implementations.
    75 	
    76 	@param aEvent A reference to a log event detail object. This value is not 
    77 	used.
    78 	@param aStatus The request status. On completion of the asynchronous request, 
    79 	it always contains KErrNotSupported.
    80 	@capability Note For built-in event types, the required capability level is defined in
    81 	the event type's write access policy. */
    82 EXPORT_C void CLogBase::ChangeEvent(const CLogEvent&, TRequestStatus& aStatus)
    83 	{
    84 	TRequestStatus* st = &aStatus;
    85 	User::RequestComplete(st, KErrNotSupported);
    86 	}
    87 
    88 /** Deletes an event from the log. This is an asynchronous request. 
    89 	
    90 	This function is overridden by log engine implementations.
    91 	
    92 	@param aId The unique event ID of the event to be deleted. This value is not 
    93 	used.
    94 	@param aStatus The request status. On completion of the asynchronous request, 
    95 	it always contains KErrNotSupported..
    96 	@capability Note For built-in event types, the required capability level is defined in
    97 	the event type's write access policy. */
    98 EXPORT_C void CLogBase::DeleteEvent(TLogId, TRequestStatus& aStatus)
    99 	{
   100 	TRequestStatus* st = &aStatus;
   101 	User::RequestComplete(st, KErrNotSupported);
   102 	}
   103 
   104 /** Gets a standard string from the logwrap.dll resource file.
   105 	
   106 	This function is overridden by log engine implementations.
   107 	
   108 	@param aString A modifiable descriptor. The length of this descriptor is set 
   109 	to zero.
   110 	@param aId The resource ID for the string. This value is not used.
   111 	@return KErrNotSupported.
   112 	@see RResourceFile */
   113 EXPORT_C TInt CLogBase::GetString(TDes& aString, TInt) const
   114 	{
   115 	aString.Zero();
   116 	return KErrNotSupported;
   117 	}
   118 
   119 void CLogBase::DoRunL()
   120 	{
   121 	__ASSERT_DEBUG(ETrue, Panic(ELogNotImplemented));
   122 	}
   123 
   124 #pragma BullseyeCoverage on
   125 
   126 EXPORT_C void CLogBase::LoadResourcesL(RFs& aFs)
   127 	{
   128 	// Find the resource file
   129     TFileName fileName;
   130     Dll::FileName(fileName);
   131 
   132     TParse parse;
   133     parse.Set(KLogResourceFile, &fileName, NULL);
   134 	fileName = parse.FullName();
   135 
   136 	// Get language of resource file
   137 	BaflUtils::NearestLanguageFile(aFs, fileName);
   138 
   139 	// Creating resource file member with 0 offset and 0 section size
   140 	iResourceFile = CResourceFile::NewL(aFs, fileName, 0, 0);  
   141 	}
   142 
   143 #pragma BullseyeCoverage off
   144 
   145 EXPORT_C void CLogBase::CLogBase_Reserved1()
   146 	{
   147 	}
   148 
   149 #pragma BullseyeCoverage on