|
1 // Copyright (c) 2005-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 // XmlEngDFileOutputStream.h |
|
15 // Interface class describing class that may be used as |
|
16 // output stream for dom tree |
|
17 // |
|
18 |
|
19 |
|
20 #ifndef CTestFileOutputStream_H_INCLUDED |
|
21 #define CTestFileOutputStream_H_INCLUDED |
|
22 |
|
23 #include <f32file.h> |
|
24 #include "XmlEngOutputStream.h" |
|
25 |
|
26 |
|
27 |
|
28 /** |
|
29 * TXmlEngFileOutputStream is used by XML Engine to serialize XML data from file. XmlEngineDOM.lib |
|
30 * |
|
31 * @since S60 v3.2 |
|
32 */ |
|
33 class CTestFileOutputStream : public MXmlEngOutputStream |
|
34 { |
|
35 public: |
|
36 /** |
|
37 * Default constructor |
|
38 * |
|
39 * @since S60 v3.2 |
|
40 * @param aFile Instance of class RFile |
|
41 * @param aRFs File server handle |
|
42 */ |
|
43 CTestFileOutputStream(RFile& aFile,RFs& aRFs); |
|
44 |
|
45 /** |
|
46 * Callback for writing a buffer with data to output stream |
|
47 * |
|
48 * @since S60 v3.2 |
|
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 * @since S60 v3.2 |
|
57 * @return |
|
58 * 0 is succeeded, |
|
59 * -1 in case of error |
|
60 */ |
|
61 TInt Close(); |
|
62 |
|
63 /** |
|
64 * Checks error flag |
|
65 * |
|
66 * @since S60 v3.2 |
|
67 * @return error code |
|
68 */ |
|
69 TInt CheckError(); |
|
70 |
|
71 private: |
|
72 |
|
73 void WriteL(const TDesC8 &aBuffer); |
|
74 |
|
75 private: |
|
76 /** |
|
77 *Instance of class RFile |
|
78 */ |
|
79 RFile iFile; |
|
80 |
|
81 /** |
|
82 * File server handle |
|
83 */ |
|
84 RFs iRFs; |
|
85 |
|
86 /** Error flag **/ |
|
87 TInt iError; |
|
88 }; |
|
89 |
|
90 |
|
91 |
|
92 #endif /* CTestFileOutputStream_H_INCLUDED */ |