|
1 // Copyright (c) 1997-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 // |
|
15 |
|
16 #if !defined(__EXBUF_H__) |
|
17 #define __EXBUF_H__ |
|
18 |
|
19 |
|
20 |
|
21 class CExportBufferBase : public CBase |
|
22 /** |
|
23 CExportBufferBase |
|
24 @publishedPartner |
|
25 @deprecated |
|
26 */ |
|
27 { |
|
28 // The purpose of this class is to provide a method of |
|
29 // abstracting the destination of an output through a buffer |
|
30 // The class is intended to be used for a single output then destroyed |
|
31 public: |
|
32 IMPORT_C CExportBufferBase(TInt aMaxSize); |
|
33 IMPORT_C ~CExportBufferBase(); |
|
34 IMPORT_C void ConstructL(); |
|
35 virtual void CommitExportBufferL()=0; |
|
36 IMPORT_C void ResetExportBuffer(); |
|
37 IMPORT_C void ResetWritePtr(); |
|
38 IMPORT_C void FinalizeExport(); |
|
39 IMPORT_C void InsertL(TText aText); // !! TText should be TText8 - do I need an overload here for Unicode? |
|
40 protected: |
|
41 TInt iExportBufferLength; |
|
42 HBufC* iExportBuffer; |
|
43 private: |
|
44 TText* iWritePtr; |
|
45 TText* iTBase; |
|
46 TInt iMaxSize; |
|
47 }; |
|
48 |
|
49 |
|
50 |
|
51 class CExportDynamicBuffer : public CExportBufferBase |
|
52 /** |
|
53 CExportDynamicBuffer |
|
54 @publishedPartner |
|
55 @deprecated |
|
56 */ |
|
57 { |
|
58 public: |
|
59 IMPORT_C static CExportDynamicBuffer* NewL(TInt aSize, CBufBase& aDynamicBuffer); |
|
60 IMPORT_C void ConstructL(); |
|
61 public: // from CExportBufferBase |
|
62 IMPORT_C void CommitExportBufferL(); |
|
63 private: |
|
64 CExportDynamicBuffer(TInt aSize, CBufBase& aDynamicBuffer); |
|
65 private: |
|
66 CBufBase& iOutput; |
|
67 }; |
|
68 |
|
69 #endif // __EXBUF_H__ |