0
|
1 |
// Copyright (c) 2006-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 |
// Implements file writer plugin
|
|
15 |
// Definition of the file writer plugin.
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalTechnology
|
|
21 |
@released
|
|
22 |
*/
|
|
23 |
|
|
24 |
#ifndef __FILE_WRITER_H__
|
|
25 |
#define __FILE_WRITER_H__
|
|
26 |
|
|
27 |
#include <e32hashtab.h>
|
|
28 |
#include <crashdatasave.h>
|
|
29 |
|
|
30 |
const TUint32 KFileWriterUid = { 0x102831e4 };
|
|
31 |
|
|
32 |
/**
|
|
33 |
@internalTechnology
|
|
34 |
@released
|
|
35 |
|
|
36 |
File writer plugin is loaded by the core dump server and used by formatter plugin to write dump data to a file.
|
|
37 |
*/
|
|
38 |
class CFileWriter : public CCrashDataSave
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
static CFileWriter* NewL();
|
|
42 |
static CFileWriter* NewLC();
|
|
43 |
~CFileWriter();
|
|
44 |
|
|
45 |
public:
|
|
46 |
|
|
47 |
virtual void GetDescription( TDes & aPluginDescription );
|
|
48 |
virtual TInt GetNumberConfigParametersL( );
|
|
49 |
virtual COptionConfig * GetConfigParameterL( const TInt aIndex );
|
|
50 |
virtual void SetConfigParameterL( const TInt aIndex, const TInt32 & aValue, const TDesC & aDescValue );
|
|
51 |
virtual const TDesC& GetMediaName();
|
|
52 |
|
|
53 |
// Called by formatter to start the creation of a dump. Can be called several times to create several dumps
|
|
54 |
void OpenL( const TDesC& aFileName );
|
|
55 |
TInt Open( const TDesC& aFileName );
|
|
56 |
|
|
57 |
// Called by formatter to end the creation of a dump. Open() and Close() must be paired calls
|
|
58 |
void CloseL();
|
|
59 |
TInt Close();
|
|
60 |
|
|
61 |
// Save aData - binary
|
|
62 |
void WriteL( const TDesC8& aData );
|
|
63 |
TInt Write( const TDesC8& aData );
|
|
64 |
|
|
65 |
// Save aData - raw
|
|
66 |
void WriteL( TAny* aData, TUint aSize );
|
|
67 |
TInt Write( TAny* aData, TUint aSize );
|
|
68 |
|
|
69 |
// Save aData at the specific position - binary - need implementation
|
|
70 |
void WriteL( TInt aPos, const TDesC8& aData );
|
|
71 |
TInt Write( TInt aPos, const TDesC8& aData );
|
|
72 |
|
|
73 |
// Save aData at the specific position - raw
|
|
74 |
void WriteL( TInt aPos, TAny* aData, TUint aSize );
|
|
75 |
TInt Write( TInt aPos, TAny* aData, TUint aSize );
|
|
76 |
|
|
77 |
private:
|
|
78 |
void ConstructL();
|
|
79 |
CFileWriter();
|
|
80 |
|
|
81 |
private:
|
|
82 |
HBufC* iDescription; /** plugin description string */
|
|
83 |
RFs iFs; /** file server session handle */
|
|
84 |
RFile iFile; /** dump file handle */
|
|
85 |
TBuf<KMaxFileName> iFileName; /** filename to be used */
|
|
86 |
};
|
|
87 |
|
|
88 |
#endif // __FILE_WRITER_H__
|