browserutilities/feedsengine/FeedsServer/XmlUtils/inc/CleanupLibXml2.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2005 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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  A util class to cleanup libxml2 related instances.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CLEANUP_LIBXML2_H
       
    20 #define CLEANUP_LIBXML2_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32std.h>
       
    25 #include <libxml2_parser.h>
       
    26 #include "libxml2_xmlwriter.h"
       
    27 #include <xmlengxestrings.h>
       
    28 // CONSTANTS
       
    29 
       
    30 // MACROS
       
    31 
       
    32 // DATA TYPES
       
    33 
       
    34 // FUNCTION PROTOTYPES
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 
       
    41 /**
       
    42 *  A util class to cleanup libxml2 related instances.
       
    43 *
       
    44 *  \b Library: FeedsEngine.lib
       
    45 *
       
    46 *  @since 3.0
       
    47 */
       
    48 class CleanupLibXml2
       
    49     {
       
    50     public:
       
    51         /**
       
    52         * Pushes a Libxml2 doc-ptr on the cleanup stack.
       
    53         *
       
    54         * @since 3.0
       
    55         * @param aDocPtr A libxml2 document ptr.
       
    56         * @return void.
       
    57         */
       
    58         static void PushL(xmlDocPtr aDocPtr);
       
    59 
       
    60         /**
       
    61         * Pushes a Libxml2 string on the cleanup stack.
       
    62         *
       
    63         * @since 3.0
       
    64         * @param aXmlString A libxml2 string.
       
    65         * @return void.
       
    66         */
       
    67         static void PushL(xmlChar* aXmlString);
       
    68 
       
    69         /**
       
    70         * Pushes a Libxml2 buffer-ptr on the cleanup stack.
       
    71         *
       
    72         * @since 3.0
       
    73         * @param aXmlString A libxml2 buffer-ptr.
       
    74         * @return void.
       
    75         */
       
    76         static void PushL(xmlBufferPtr aBufferPtr);
       
    77 
       
    78         /**
       
    79         * Pushes a Libxml2 text-writer-ptr on the cleanup stack.
       
    80         *
       
    81         * @since 3.0
       
    82         * @param aTextWriterPtr A libxml2 text-writer-ptr.
       
    83         * @return void.
       
    84         */
       
    85         static void PushL(xmlTextWriterPtr aTextWriterPtr);
       
    86 
       
    87 
       
    88     private:
       
    89         /**
       
    90         * Cleanup stack callback method to delete a Libxml2 doc-ptr.
       
    91         *
       
    92         * @since 3.0
       
    93         * @param aPtr A libxml2 document ptr.
       
    94         * @return void.
       
    95         */
       
    96         static void CleanupXmlDocPtr(TAny *aPtr);
       
    97 
       
    98         /**
       
    99         * Cleanup stack callback method to delete a Libxml2 string.
       
   100         *
       
   101         * @since 3.0
       
   102         * @param aPtr A libxml2 string.
       
   103         * @return void.
       
   104         */
       
   105         static void CleanupXmlString(TAny *aPtr);
       
   106 
       
   107         /**
       
   108         * Cleanup stack callback method to delete a Libxml2 buffer-ptr.
       
   109         *
       
   110         * @since 3.0
       
   111         * @param aPtr A libxml2 buffer-ptr.
       
   112         * @return void.
       
   113         */
       
   114         static void CleanupXmlBufferPtr(TAny *aPtr);
       
   115 
       
   116         /**
       
   117         * Cleanup stack callback method to delete a Libxml2 text-writer-ptr.
       
   118         *
       
   119         * @since 3.0
       
   120         * @param aPtr A libxml2 text-writer-ptr.
       
   121         * @return void.
       
   122         */
       
   123         static void CleanupXmlTextWriterPtr(TAny *aPtr);
       
   124     };
       
   125 
       
   126 #endif      // CLEANUP_LIBXML2_H
       
   127             
       
   128 // End of File