1 /* |
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2006-2006 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
3 * All rights reserved. |
3 // This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
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 |
5 // which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
7 // |
8 * |
8 // Initial Contributors: |
9 * Initial Contributors: |
9 // Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
10 // |
11 * |
11 // Contributors: |
12 * Contributors: |
12 // |
13 * |
13 // Description: |
14 * Description: All binary data functions |
14 // All binary data functions |
15 * |
15 // |
16 */ |
|
17 |
16 |
18 |
17 |
19 |
18 |
|
19 /** |
|
20 @file |
|
21 @publishedAll |
|
22 @released |
|
23 */ |
|
24 #ifndef XMLENGBINARYCONTAINER_H |
|
25 #define XMLENGBINARYCONTAINER_H |
20 |
26 |
21 |
27 #include <xml/dom/xmlengdatacontainer.h> |
22 |
|
23 |
|
24 #ifndef XMLENGINE_BINARYCONTAINER_H_INCLUDED |
|
25 #define XMLENGINE_BINARYCONTAINER_H_INCLUDED |
|
26 |
|
27 #include "xmlengdatacontainer.h" |
|
28 |
28 |
29 /** |
29 /** |
30 * Instance of TXmlEngBinaryContainer class represents binary data in |
30 This class represents binary data in a DOM tree. |
31 * DOM tree. |
31 |
32 * |
32 Binary data is treated in general as text nodes in DOM tree. |
33 * Binary data is treated in general as text nodes in DOM tree. |
33 Data is stored in process's heap memory. |
34 * Some of the fields in xmlNode structure are reused in order to save memory. |
34 |
35 * Data is stored in process's heap memory. |
35 Sample code for creating binary container: |
36 * |
36 @code |
37 * Sample code for creating binary container: |
37 RXmlEngDOMImplementation domImpl; |
38 * @code |
38 domImpl.OpenL(); // opening DOM implementation object |
39 * RXmlEngDOMImplementation domImpl; |
39 RXmlEngDocument iDoc; |
40 * domImpl.OpenL(); ///< opening DOM implementation object |
40 // create document element |
41 * RXmlEngDocument iDoc; |
41 TXmlEngElement elem = iDoc.CreateDocumentElementL(_L8("doc")); |
42 * ///< create document element |
42 // create binary container from buffer (str1) and CID equals cid |
43 * TXmlEngElement elem = iDoc.CreateDocumentElementL(_L8("doc")); |
43 TXmlEngBinaryContainer binData=iDoc.CreateBinaryContainerL(cid,*str1); |
44 * ///< create binary container from buffer (str1) and CID equals cid |
44 elem.AppendChildL(binData); // append container to the dom tree |
45 * TXmlEngBinaryContainer binData=iDoc.CreateBinaryContainerL(cid,*str1); |
45 iDoc.Close(); // closing all opened objects |
46 * elem.AppendChildL(binData); ///< append container to the dom tree |
46 domImpl.Close(); |
47 * iDoc.Close(); ///< closing all opened objects |
47 @endcode |
48 * domImpl.Close(); |
|
49 * @endcode |
|
50 * |
|
51 * @lib XmlEngineDOM.lib |
|
52 * @since S60 v3.2 |
|
53 */ |
48 */ |
54 class TXmlEngBinaryContainer : public TXmlEngDataContainer |
49 class TXmlEngBinaryContainer : public TXmlEngDataContainer |
55 { |
50 { |
56 public: |
51 public: |
57 |
52 |
58 /** |
53 /** Get content of the container. |
59 * Get content of the container. |
54 @return The contents of the container |
60 * |
55 */ |
61 * @since S60 v3.2 |
|
62 * @return TPtrC8 with container content |
|
63 * |
|
64 */ |
|
65 IMPORT_C TPtrC8 Contents() const; |
56 IMPORT_C TPtrC8 Contents() const; |
66 |
57 |
67 /** |
58 /** |
68 * Sets contents of binary container |
59 Copies the given string and sets the contents of the binary container |
69 * |
60 @param aNewContents The actual value to store |
70 * @since S60 v3.2 |
61 @leave KXmlEngErrNullNode Node is NULL |
71 * @param aNewContents The actual value to store |
62 @leave - One of the system-wide error codes |
72 */ |
63 */ |
73 IMPORT_C void SetContentsL( const TDesC8& aNewContents ); |
64 IMPORT_C void SetContentsL( const TDesC8& aNewContents ); |
74 |
65 |
75 /** |
66 /** |
76 * Appends contents to binary container |
67 Appends contents to binary container |
77 * |
68 @param aData Content to be appended |
78 * @since S60 v3.2 |
69 @leave KXmlEngErrNullNode Node is NULL |
79 * @param aData Content to be appended to current content |
70 @leave - One of the system-wide error codes |
80 */ |
71 */ |
81 EXPORT_C void AppendContentsL( const TDesC8& aData ); |
72 EXPORT_C void AppendContentsL( const TDesC8& aData ); |
82 |
73 |
83 /** |
74 /** Default constructor */ |
84 * Default constructor |
|
85 * |
|
86 * @since S60 v3.1 |
|
87 */ |
|
88 inline TXmlEngBinaryContainer(); |
75 inline TXmlEngBinaryContainer(); |
89 |
76 |
90 protected: |
77 protected: |
91 |
78 |
92 /** |
79 /** |
93 * Constructor |
80 Constructor |
94 * |
81 @param aInternal node pointer |
95 * @since S60 v3.1 |
82 */ |
96 * @param aInternal node pointer |
|
97 */ |
|
98 inline TXmlEngBinaryContainer(void* aInternal); |
83 inline TXmlEngBinaryContainer(void* aInternal); |
99 }; |
84 }; |
100 |
85 |
101 #include "xmlengbinarycontainer.inl" |
86 #include <xml/dom/xmlengbinarycontainer.inl> |
102 |
87 |
103 #endif /* XMLENGINE_BINARYCONTAINER_H_INCLUDED */ |
88 #endif /* XMLENGBINARYCONTAINER_H */ |
|
89 |