|
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 #ifndef MEMSPYDRIVERSTREAMWRITER_H |
|
19 #define MEMSPYDRIVERSTREAMWRITER_H |
|
20 |
|
21 // System includes |
|
22 #include <e32cmn.h> |
|
23 #include <kernel.h> |
|
24 |
|
25 // Classes referenced |
|
26 class DMemSpyDriverXferBuffer; |
|
27 |
|
28 |
|
29 class RMemSpyMemStreamWriter |
|
30 { |
|
31 public: |
|
32 RMemSpyMemStreamWriter(); |
|
33 RMemSpyMemStreamWriter( DMemSpyDriverXferBuffer& aBuffer ); |
|
34 |
|
35 public: // API - closure |
|
36 void Close(); |
|
37 TInt WriteAndClose( TDes8* aDestinationPointer ); |
|
38 |
|
39 public: // API - writing |
|
40 TInt32* WriteInt32( TInt32 aValue ); |
|
41 TUint32* WriteUint32( TUint32 aValue ); |
|
42 |
|
43 public: // API - positioning |
|
44 TUint8* Current() const; |
|
45 void Seek( TInt aPosition ); |
|
46 TUint32 Remaining() const; |
|
47 |
|
48 public: // API - marking |
|
49 void MarkSet(); |
|
50 void MarkResume(); |
|
51 |
|
52 public: // API - misc |
|
53 TBool IsFull() const; |
|
54 TBool IsOpen() const; |
|
55 |
|
56 public: // API - operators |
|
57 RMemSpyMemStreamWriter& operator=( const RMemSpyMemStreamWriter& aCopy ); |
|
58 |
|
59 private: // Internal methods |
|
60 void IncrementPos( TInt aAmount ); |
|
61 |
|
62 private: |
|
63 DMemSpyDriverXferBuffer* iBuffer; |
|
64 TUint8* iCurrent; |
|
65 TUint8* iMax; |
|
66 TUint8* iMark; |
|
67 TInt iCommitted; |
|
68 }; |
|
69 |
|
70 |
|
71 #endif |