sl@0
|
1 |
// Copyright (c) 2005-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 the License "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 |
// e32test\debug\d_logtofile.h
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#ifndef __D_LOGTOFILE_H__
|
sl@0
|
19 |
#define __D_LOGTOFILE_H__
|
sl@0
|
20 |
|
sl@0
|
21 |
#include <e32cmn.h>
|
sl@0
|
22 |
#ifndef __KERNEL_MODE__
|
sl@0
|
23 |
#include <e32std.h>
|
sl@0
|
24 |
#endif
|
sl@0
|
25 |
|
sl@0
|
26 |
/**
|
sl@0
|
27 |
Data structure for CreateChunk call to ldd
|
sl@0
|
28 |
*/
|
sl@0
|
29 |
struct TChunkCreateStr
|
sl@0
|
30 |
{
|
sl@0
|
31 |
TInt iSize; /**The size of the chunk to be created*/
|
sl@0
|
32 |
TBuf8<10> iPattern; /**The matching pattern*/
|
sl@0
|
33 |
};
|
sl@0
|
34 |
|
sl@0
|
35 |
/**
|
sl@0
|
36 |
The user side class for controlling trace handler hook.
|
sl@0
|
37 |
*/
|
sl@0
|
38 |
class RLogToFileDevice : public RBusLogicalChannel
|
sl@0
|
39 |
{
|
sl@0
|
40 |
public:
|
sl@0
|
41 |
enum TControl
|
sl@0
|
42 |
{
|
sl@0
|
43 |
EControlCreateChunk,
|
sl@0
|
44 |
EControlStart,
|
sl@0
|
45 |
EControlStop,
|
sl@0
|
46 |
EControlRemoveChunk,
|
sl@0
|
47 |
};
|
sl@0
|
48 |
public:
|
sl@0
|
49 |
#ifndef __KERNEL_MODE__
|
sl@0
|
50 |
|
sl@0
|
51 |
inline TInt Open();
|
sl@0
|
52 |
inline TInt CreateChunk(TChunkCreateStr* aStr);
|
sl@0
|
53 |
inline void Start();
|
sl@0
|
54 |
inline TInt Stop();
|
sl@0
|
55 |
inline void RemoveChunk();
|
sl@0
|
56 |
#endif //__KERNEL_MODE__
|
sl@0
|
57 |
};
|
sl@0
|
58 |
|
sl@0
|
59 |
_LIT(KLogToFileName,"d_logtofile");
|
sl@0
|
60 |
|
sl@0
|
61 |
#ifndef __KERNEL_MODE__
|
sl@0
|
62 |
/** Opens a channel*/
|
sl@0
|
63 |
inline TInt RLogToFileDevice::Open()
|
sl@0
|
64 |
{return DoCreate(KLogToFileName,TVersion(1,0,0),KNullUnit,NULL,NULL);}
|
sl@0
|
65 |
/**Creates a chunk. Returns user side handle*/
|
sl@0
|
66 |
inline TInt RLogToFileDevice::CreateChunk(TChunkCreateStr* aStr)
|
sl@0
|
67 |
{return DoControl(EControlCreateChunk, reinterpret_cast<TAny*>(aStr));}
|
sl@0
|
68 |
/**Starts logging into the chunk*/
|
sl@0
|
69 |
inline void RLogToFileDevice::Start()
|
sl@0
|
70 |
{DoControl(EControlStart);}
|
sl@0
|
71 |
/**Stops logging into the chunk. Returns the size of the log.*/
|
sl@0
|
72 |
inline TInt RLogToFileDevice::Stop()
|
sl@0
|
73 |
{return DoControl(EControlStop);}
|
sl@0
|
74 |
/*Destroys the chunk*/
|
sl@0
|
75 |
inline void RLogToFileDevice::RemoveChunk()
|
sl@0
|
76 |
{DoControl(EControlRemoveChunk);}
|
sl@0
|
77 |
#endif //__KERNEL_MODE__
|
sl@0
|
78 |
#endif //__D_LOGTOFILE_H__
|