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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // All binary data functions
24 #ifndef XMLENGBINARYCONTAINER_H
25 #define XMLENGBINARYCONTAINER_H
27 #include <xml/dom/xmlengdatacontainer.h>
30 This class represents binary data in a DOM tree.
32 Binary data is treated in general as text nodes in DOM tree.
33 Data is stored in process's heap memory.
35 Sample code for creating binary container:
37 RXmlEngDOMImplementation domImpl;
38 domImpl.OpenL(); // opening DOM implementation object
40 // create document element
41 TXmlEngElement elem = iDoc.CreateDocumentElementL(_L8("doc"));
42 // create binary container from buffer (str1) and CID equals cid
43 TXmlEngBinaryContainer binData=iDoc.CreateBinaryContainerL(cid,*str1);
44 elem.AppendChildL(binData); // append container to the dom tree
45 iDoc.Close(); // closing all opened objects
49 class TXmlEngBinaryContainer : public TXmlEngDataContainer
53 /** Get content of the container.
54 @return The contents of the container
56 IMPORT_C TPtrC8 Contents() const;
59 Copies the given string and sets the contents of the binary container
60 @param aNewContents The actual value to store
61 @leave KXmlEngErrNullNode Node is NULL
62 @leave - One of the system-wide error codes
64 IMPORT_C void SetContentsL( const TDesC8& aNewContents );
67 Appends contents to binary container
68 @param aData Content to be appended
69 @leave KXmlEngErrNullNode Node is NULL
70 @leave - One of the system-wide error codes
72 EXPORT_C void AppendContentsL( const TDesC8& aData );
74 /** Default constructor */
75 inline TXmlEngBinaryContainer();
81 @param aInternal node pointer
83 inline TXmlEngBinaryContainer(void* aInternal);
86 #include <xml/dom/xmlengbinarycontainer.inl>
88 #endif /* XMLENGBINARYCONTAINER_H */