|
1 // Copyright (c) 2006-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 // Implementation of XOP serializer Output Stream |
|
15 // |
|
16 |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 @released |
|
23 */ |
|
24 #ifndef XMLENGXOPFILEOUTPUTSTREAM_H |
|
25 #define XMLENGXOPFILEOUTPUTSTREAM_H |
|
26 |
|
27 #include <f32file.h> |
|
28 #include "xmlengxopoutputstream.h" |
|
29 |
|
30 /** |
|
31 * TXmlEngSerializerXOPOS is used by XML Engine Serializer to |
|
32 * serialize XML data to file. |
|
33 * |
|
34 */ |
|
35 class TXmlEngSXOPFileOutputStream : public MXmlEngSXOPOutputStream |
|
36 { |
|
37 public: |
|
38 /** |
|
39 * Default constructor |
|
40 * |
|
41 * @param aFile Instance of class RFile |
|
42 * @param aRFs File server handle |
|
43 */ |
|
44 TXmlEngSXOPFileOutputStream(RFile& aFile,RFs& aRFs); |
|
45 |
|
46 /** |
|
47 * Callback for writing a buffer with data to output stream |
|
48 * |
|
49 * @return number of bytes written or -1 in case of error |
|
50 */ |
|
51 TInt Write(const TDesC8 &aBuffer); |
|
52 |
|
53 /** |
|
54 * Callback for closing output stream |
|
55 * |
|
56 * @return |
|
57 * 0 is succeeded, |
|
58 * -1 in case of error |
|
59 */ |
|
60 TInt Close(); |
|
61 |
|
62 /** |
|
63 * Callback for closing file |
|
64 * |
|
65 * @return KErrNone or other error code |
|
66 */ |
|
67 virtual TInt CloseAll(); |
|
68 |
|
69 /** |
|
70 * Checks error flag |
|
71 * |
|
72 * @return error code |
|
73 */ |
|
74 virtual TInt CheckError(); |
|
75 |
|
76 private: // functions |
|
77 |
|
78 /** |
|
79 * Callback for writing a buffer with data to output stream |
|
80 */ |
|
81 void WriteL(const TDesC8 &aBuffer); |
|
82 |
|
83 private: // data |
|
84 /** |
|
85 *Instance of class RFile |
|
86 */ |
|
87 RFile iFile; |
|
88 |
|
89 /** |
|
90 * File server handle |
|
91 */ |
|
92 RFs iRFs; |
|
93 |
|
94 /** Error flag **/ |
|
95 TInt iError; |
|
96 |
|
97 /** Drive No. **/ |
|
98 TInt iDrive; |
|
99 }; |
|
100 |
|
101 |
|
102 |
|
103 #endif /* XMLENGXOPFILEOUTPUTSTREAM_H */ |