|
1 /* |
|
2 * Copyright (c) 2005 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: Abstract base class for encoder output. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPOSLMOUTPUT_H |
|
20 #define CPOSLMOUTPUT_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class RWriteStream; |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * Abstract base class for encoder output. |
|
32 * |
|
33 */ |
|
34 class CPosLmOutput : public CBase |
|
35 { |
|
36 public: // Constructors and destructor |
|
37 |
|
38 /** |
|
39 * Destructor. |
|
40 */ |
|
41 virtual ~CPosLmOutput(); |
|
42 |
|
43 public: // New functions |
|
44 |
|
45 /** |
|
46 * Writes the content of the 16 bit descriptor to this output. |
|
47 * |
|
48 * @param aDes A reference to a descriptor. |
|
49 */ |
|
50 void WriteL( |
|
51 /* IN */ const TDesC16& aDes |
|
52 ); |
|
53 |
|
54 /** |
|
55 * Writes the content of the 16 bit descriptor to this output. |
|
56 * Deletes the descriptor (using CleanupStack::PopAndDestroy()). |
|
57 * |
|
58 * @param aDes A reference to a descriptor. Must have been pushed to the |
|
59 * CleanupStack. |
|
60 */ |
|
61 void WriteAndDeleteL( |
|
62 /* IN */ TDesC16* aDes |
|
63 ); |
|
64 |
|
65 /** |
|
66 * Writes a TReal value as a string to this output. |
|
67 * |
|
68 * @param aValue The value to be written. |
|
69 */ |
|
70 void WriteTRealL( |
|
71 /* IN */ TReal aValue |
|
72 ); |
|
73 |
|
74 /** |
|
75 * Writes a TUint value as a string to this output. |
|
76 * |
|
77 * @param aValue The value to be written. |
|
78 */ |
|
79 void WriteTUintL( |
|
80 /* IN */ TUint aValue |
|
81 ); |
|
82 |
|
83 /** |
|
84 * Ensures that any buffered data is written to this output. |
|
85 */ |
|
86 virtual void CommitL(); |
|
87 |
|
88 /** |
|
89 * Optionally performs a low disk check by the sub class. Leaves with |
|
90 * KErrDiskFull if the disk is full. |
|
91 * |
|
92 * @param aDesc A descriptor that should be written to the output. |
|
93 */ |
|
94 virtual void CheckLowDiskL( |
|
95 /* IN */ const TDesC16& aDesc |
|
96 ) = 0; |
|
97 |
|
98 protected: // New functions |
|
99 |
|
100 /** |
|
101 * C++ default constructor. |
|
102 */ |
|
103 CPosLmOutput(); |
|
104 |
|
105 /** |
|
106 * Symbian 2nd phase constructor. |
|
107 * |
|
108 * @param aWriteStream The write stream to be used by this output. |
|
109 */ |
|
110 void BaseConstructL( |
|
111 /* IN */ RWriteStream& aWriteStream |
|
112 ); |
|
113 |
|
114 private: |
|
115 |
|
116 // Prohibit copy constructor if not deriving from CBase. |
|
117 CPosLmOutput( const CPosLmOutput& ); |
|
118 // Prohibit assigment operator if not deriving from CBase. |
|
119 CPosLmOutput& operator=( const CPosLmOutput& ); |
|
120 |
|
121 private: // Data |
|
122 |
|
123 RWriteStream* iWriteStream; // No ownership |
|
124 }; |
|
125 |
|
126 #endif // CPOSLMOUTPUT_H |
|
127 |
|
128 // End of File |