|
1 /* |
|
2 * Copyright (c) 2003-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 * Name : MessageWriter.h |
|
16 * Part of : compressor |
|
17 * Interface : |
|
18 * SigComp message writer |
|
19 * Version : 1.0 |
|
20 * |
|
21 */ |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 /** |
|
27 @internalComponent |
|
28 */ |
|
29 |
|
30 |
|
31 #ifndef MESSAGEWRITER_H |
|
32 #define MESSAGEWRITER_H |
|
33 |
|
34 // INCLUDES |
|
35 #include <e32base.h> |
|
36 |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * @brief Class for writing to sigcomp message. |
|
42 * |
|
43 * @class CMessageWriter messagewriter.h "messagewriter.h" |
|
44 * |
|
45 * This class is used for writing to sigcomp message with |
|
46 * optional record marker encoding as |
|
47 * specified in RFC 3320, chapter 4.2.2 |
|
48 */ |
|
49 |
|
50 class CMessageWriter : public CBase |
|
51 { |
|
52 public: |
|
53 |
|
54 /** |
|
55 * Constructs object. |
|
56 * |
|
57 * @param aBuffer buffer to write into. |
|
58 * @param aStreamBasedProtocol if ETrue, a message will be |
|
59 * record marker encoded |
|
60 */ |
|
61 |
|
62 CMessageWriter(CBufBase* aBuffer, TBool aStreamBasedProtocol); |
|
63 |
|
64 /** |
|
65 * Write one byte to buffer. |
|
66 * |
|
67 * @param aByte byte to write |
|
68 */ |
|
69 |
|
70 void WriteByteL(TInt aByte); |
|
71 |
|
72 /** |
|
73 * Write block of bytes to buffer. |
|
74 * |
|
75 * @param aBlock block of bytes to write; Length() |
|
76 * specifies number of bytes to write |
|
77 */ |
|
78 |
|
79 void WriteBlockL(const TDesC8& aBlock); |
|
80 |
|
81 /** |
|
82 * Flush cached data to buffer and optionally generate |
|
83 * stream delimiter. |
|
84 */ |
|
85 |
|
86 void FlushAndTerminateL(); |
|
87 |
|
88 private: // Data |
|
89 |
|
90 CBufBase* iBuffer; |
|
91 TBool iStreamBasedProtocol; |
|
92 TInt iCount; |
|
93 }; |
|
94 |
|
95 #endif |
|
96 |
|
97 // End of File |