|
1 /* |
|
2 * Copyright (c) 2006-2006 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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: All memory chunk data functions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 #ifndef XMLENGINE_CHUNKCONTAINER_H_INCLUDED |
|
25 #define XMLENGINE_CHUNKCONTAINER_H_INCLUDED |
|
26 |
|
27 #include "xmlengdatacontainer.h" |
|
28 |
|
29 |
|
30 /** |
|
31 * Instance of TXmlEngChunkContainer class represents data stored in RChunks in DOM tree |
|
32 * |
|
33 * RChunk data is treated in general as text nodes in DOM tree. |
|
34 * Some of the fields in xmlNode structure are reused in order to save memory. |
|
35 * Data is stored in memory referenced to by RChunk. |
|
36 * |
|
37 * Sample code for creating chunk container: |
|
38 * @code |
|
39 * RXmlEngDOMImplementation domImpl; |
|
40 * domImpl.OpenL(); ///< opening DOM implementation object |
|
41 * RXmlEngDocument iDoc; |
|
42 * ///< create document element |
|
43 * TXmlEngElement elem = iDoc.CreateDocumentElementL(_L8("doc")); |
|
44 * ///< create RChunk object with chunkName name and size |
|
45 * RChunk chunk; |
|
46 * chunk.CreateGlobal(chunkName, size, maxSize); |
|
47 * CleanupClosePushL(chunk); |
|
48 * ///< create chunk container from Rchunk object with offset to the |
|
49 * ///< binary data in chunk and binary data size in chunk (binarySize) |
|
50 * TXmlEngChunkContainer binData = iDoc.CreateChunkContainerL( |
|
51 * cid,chunk,offset,binarySize); |
|
52 * ///< append chunkcontainer to the dom tree |
|
53 * TXmlEngNode ref = iDoc.DocumentElement().AppendChildL(binData); |
|
54 * ///< closing all opened objects |
|
55 * CleanupStack::PopAndDestroy();//chunk |
|
56 * iDoc.Close(); |
|
57 * domImpl.Close(); |
|
58 * @endcode |
|
59 * |
|
60 * @lib XmlEngineDOM.lib |
|
61 * @since S60 v3.2 |
|
62 */ |
|
63 class TXmlEngChunkContainer : public TXmlEngDataContainer |
|
64 { |
|
65 public: |
|
66 /** |
|
67 * Get memory chunk reference |
|
68 * |
|
69 * @since S60 v3.2 |
|
70 * @return Memory chunk reference |
|
71 * |
|
72 */ |
|
73 IMPORT_C RChunk& Chunk() const; |
|
74 |
|
75 /** |
|
76 * Get offset of binary data in memory chunk |
|
77 * |
|
78 * @since S60 v3.2 |
|
79 * @return Offset of binary data in memory chunk |
|
80 */ |
|
81 IMPORT_C TUint ChunkOffset() const; |
|
82 |
|
83 protected: |
|
84 /** |
|
85 * Default constructor |
|
86 * |
|
87 * @since S60 v3.1 |
|
88 */ |
|
89 inline TXmlEngChunkContainer(); |
|
90 |
|
91 /** |
|
92 * Constructor |
|
93 * |
|
94 * @since S60 v3.1 |
|
95 * @param aInternal node pointer |
|
96 */ |
|
97 inline TXmlEngChunkContainer(void* aInternal); |
|
98 }; |
|
99 |
|
100 |
|
101 |
|
102 #include "xmlengchunkcontainer.inl" |
|
103 |
|
104 #endif /* XMLENGINE_CHUNKCONTAINER_H_INCLUDED */ |