xml/xmldomandxpath/inc/xmlenginedom/xmlengbinarycontainer.h
changeset 0 e35f40988205
child 17 ed3155dbd163
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     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 // All binary data functions
       
    15 //
       
    16 
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21  @publishedAll
       
    22  @released
       
    23 */
       
    24 #ifndef XMLENGBINARYCONTAINER_H
       
    25 #define XMLENGBINARYCONTAINER_H
       
    26 
       
    27 #include <xml/dom/xmlengdatacontainer.h>
       
    28 
       
    29 /**
       
    30 This class represents binary data in a DOM tree.
       
    31 
       
    32 Binary data is treated in general as text nodes in DOM tree. 
       
    33 Data is stored in process's heap memory.
       
    34 
       
    35 Sample code for creating binary container:
       
    36 @code  
       
    37      RXmlEngDOMImplementation domImpl;
       
    38      domImpl.OpenL();        // opening DOM implementation object 
       
    39      RXmlEngDocument iDoc; 
       
    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
       
    46      domImpl.Close();
       
    47 @endcode 
       
    48 */
       
    49 class TXmlEngBinaryContainer : public TXmlEngDataContainer
       
    50 {
       
    51 public:
       
    52 
       
    53     /** Get content of the container.
       
    54     @return The contents of the container
       
    55     */
       
    56     IMPORT_C TPtrC8 Contents() const;
       
    57     
       
    58     /** 
       
    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
       
    63     */
       
    64     IMPORT_C void SetContentsL( const TDesC8& aNewContents );
       
    65 
       
    66     /** 
       
    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
       
    71     */    
       
    72     EXPORT_C void AppendContentsL( const TDesC8& aData );
       
    73 
       
    74     /** Default constructor */
       
    75 	inline TXmlEngBinaryContainer(); 
       
    76 
       
    77 protected:
       
    78 
       
    79     /**
       
    80     Constructor
       
    81     @param aInternal node pointer
       
    82     */
       
    83 	inline TXmlEngBinaryContainer(void* aInternal);
       
    84 };
       
    85 
       
    86 #include <xml/dom/xmlengbinarycontainer.inl>
       
    87 
       
    88 #endif /* XMLENGBINARYCONTAINER_H */
       
    89