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