|
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 // Serialize node to GZIP file |
|
15 // |
|
16 |
|
17 |
|
18 |
|
19 /** |
|
20 @file |
|
21 @internalComponent |
|
22 @released |
|
23 */ |
|
24 #ifndef XMLENGSERIALIZERGZIP_H |
|
25 #define XMLENGSERIALIZERGZIP_H |
|
26 |
|
27 #include <xml/dom/xmlengserializer.h> |
|
28 |
|
29 /** |
|
30 * XML serializer to GZIP format |
|
31 */ |
|
32 class CXmlEngSerializerGZIP: public CXmlEngSerializer |
|
33 { |
|
34 public: |
|
35 /** |
|
36 * Creates an instance of CXmlEngSerializerGZIP class |
|
37 * |
|
38 * @return Pointer to instance of CXmlEngSerializerGZIP class |
|
39 * |
|
40 * @leave KErrNoMemory, KErrGeneral, KXmlEngErrWrongEncoding. |
|
41 */ |
|
42 static CXmlEngSerializerGZIP* NewL(); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 * |
|
47 */ |
|
48 ~CXmlEngSerializerGZIP(); |
|
49 |
|
50 /** |
|
51 * Serializes TXmlEngNode |
|
52 * |
|
53 * @param aRoot Node to be serialized |
|
54 * @return Number of bytes written |
|
55 * |
|
56 * @leave KErrNoMemory, KErrGeneral, KXmlEngErrWrongEncoding. |
|
57 */ |
|
58 TInt SerializeL(const TXmlEngNode aRoot = TXmlEngNode()); |
|
59 |
|
60 /** |
|
61 * Serializes TXmlEngNode |
|
62 * |
|
63 * @param aRoot Node to be serialized |
|
64 * @param aFileName File name to which document will be serialized |
|
65 * @param aOptions Serialization options |
|
66 * @return Number of bytes written |
|
67 * |
|
68 * @leave KErrNoMemory, KErrGeneral, KXmlEngErrWrongEncoding. |
|
69 */ |
|
70 TInt SerializeL(const TDesC& aFileName, |
|
71 const TXmlEngNode aRoot = TXmlEngNode(), |
|
72 const TXmlEngSerializationOptions& aOptions = TXmlEngSerializationOptions(0)); |
|
73 |
|
74 /** |
|
75 * Serializes TXmlEngNode |
|
76 * |
|
77 * @param aRoot Node to be serialized |
|
78 * @param aRFs File server session |
|
79 * @param aFileName File name to which document will be serialized |
|
80 * @param aOptions Serialization options |
|
81 * @return Number of bytes written |
|
82 * |
|
83 * @leave KErrNoMemory, KErrGeneral, KXmlEngErrWrongEncoding. |
|
84 */ |
|
85 TInt SerializeL(RFs& aRFs, |
|
86 const TDesC& aFileName, |
|
87 const TXmlEngNode aRoot = TXmlEngNode(), |
|
88 const TXmlEngSerializationOptions& aOptions = TXmlEngSerializationOptions(0)); |
|
89 |
|
90 /** |
|
91 * Serializes TXmlEngNode to file |
|
92 * |
|
93 * @param aRoot XML data buffer |
|
94 * @param aBuffer Buffer to which document will be serialized |
|
95 * @param aOptions Serialization options |
|
96 * @return Number of bytes written |
|
97 * |
|
98 * @leave KErrNoMemory, KErrGeneral, KXmlEngErrWrongEncoding. |
|
99 */ |
|
100 TInt SerializeL(RBuf8& aBuffer, |
|
101 const TXmlEngNode aRoot = TXmlEngNode(), |
|
102 const TXmlEngSerializationOptions& aOptions = TXmlEngSerializationOptions(0)); |
|
103 |
|
104 private: |
|
105 /** |
|
106 * Constructor |
|
107 */ |
|
108 CXmlEngSerializerGZIP(); |
|
109 |
|
110 TInt SerializeToFileL(RFs& aRFs, |
|
111 const TDesC& aFileName, |
|
112 const TXmlEngNode aNode, |
|
113 const TXmlEngSerializationOptions& aOpt); |
|
114 |
|
115 TInt SerializeToBufferL(RBuf8& aBuf, |
|
116 const TXmlEngNode aNode, |
|
117 const TXmlEngSerializationOptions& aOpt); |
|
118 |
|
119 TInt SerializeToStreamL(MXmlEngOutputStream& aStream, |
|
120 const TXmlEngNode aNode, |
|
121 const TXmlEngSerializationOptions& aOpt); |
|
122 }; |
|
123 |
|
124 #endif /* XMLENGSERIALIZERGZIP_H */ |