|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "MemSpyEngineOutputSinkDebug.h" |
|
19 |
|
20 // System includes |
|
21 #include <e32svr.h> |
|
22 |
|
23 // Constants |
|
24 const TInt KMemSpyEngineOutputSinkDebugMaxLineLength = 0x100; |
|
25 |
|
26 |
|
27 CMemSpyEngineOutputSinkDebug::CMemSpyEngineOutputSinkDebug( CMemSpyEngine& aEngine ) |
|
28 : CMemSpyEngineOutputSink( aEngine ) |
|
29 { |
|
30 } |
|
31 |
|
32 |
|
33 CMemSpyEngineOutputSinkDebug::~CMemSpyEngineOutputSinkDebug() |
|
34 { |
|
35 } |
|
36 |
|
37 |
|
38 void CMemSpyEngineOutputSinkDebug::ConstructL() |
|
39 { |
|
40 BaseConstructL(); |
|
41 } |
|
42 |
|
43 |
|
44 CMemSpyEngineOutputSinkDebug* CMemSpyEngineOutputSinkDebug::NewL( CMemSpyEngine& aEngine ) |
|
45 { |
|
46 CMemSpyEngineOutputSinkDebug* self = new(ELeave) CMemSpyEngineOutputSinkDebug( aEngine ); |
|
47 CleanupStack::PushL( self ); |
|
48 self->ConstructL(); |
|
49 CleanupStack::Pop( self ); |
|
50 return self; |
|
51 } |
|
52 |
|
53 |
|
54 TMemSpySinkType CMemSpyEngineOutputSinkDebug::Type() const |
|
55 { |
|
56 return ESinkTypeDebug; |
|
57 } |
|
58 |
|
59 |
|
60 void CMemSpyEngineOutputSinkDebug::DataStreamBeginL( const TDesC& aContext, const TDesC& aFolder, const TDesC& aExtension ) |
|
61 { |
|
62 DataStreamBeginL( aContext, aFolder, aExtension, ETrue ); |
|
63 } |
|
64 |
|
65 |
|
66 void CMemSpyEngineOutputSinkDebug::DataStreamBeginL( const TDesC& aContext, const TDesC& aFolder, const TDesC& aExtension, TBool aOverwrite ) |
|
67 { |
|
68 DataStreamBeginL( aContext, aFolder, aExtension, aOverwrite, ETrue ); |
|
69 } |
|
70 |
|
71 |
|
72 void CMemSpyEngineOutputSinkDebug::DataStreamBeginL( const TDesC& /*aContext*/, const TDesC& /*aFolder*/, const TDesC& /*aExtension*/, TBool /*aOverwrite*/, TBool /*aUseTimeStamp*/ ) |
|
73 { |
|
74 // Doesn't support data streams |
|
75 } |
|
76 |
|
77 |
|
78 void CMemSpyEngineOutputSinkDebug::DataStreamEndL() |
|
79 { |
|
80 // Doesn't support data streams |
|
81 } |
|
82 |
|
83 |
|
84 void CMemSpyEngineOutputSinkDebug::DoOutputLineL( const TDesC& aLine ) |
|
85 { |
|
86 if ( !aLine.Length() ) |
|
87 { |
|
88 // Blank line is special case |
|
89 RDebug::Printf( " " ); |
|
90 } |
|
91 else |
|
92 { |
|
93 _LIT( KPrintFormat, "%S" ); |
|
94 |
|
95 HBufC* buf = aLine.AllocLC(); |
|
96 if ( aLine.Length() > KMemSpyEngineOutputSinkDebugMaxLineLength ) |
|
97 { |
|
98 buf->Des().SetLength( KMemSpyEngineOutputSinkDebugMaxLineLength ); |
|
99 } |
|
100 RDebug::Print( KPrintFormat, buf ); |
|
101 CleanupStack::PopAndDestroy( buf ); |
|
102 } |
|
103 } |
|
104 |
|
105 |
|
106 void CMemSpyEngineOutputSinkDebug::DoOutputRawL( const TDesC8& /*aData*/ ) |
|
107 { |
|
108 User::Leave( KErrNotSupported ); |
|
109 } |
|
110 |
|
111 |