xml/libxml2libs/inc/xmlengineutils/xmlengutils.h
changeset 0 e35f40988205
equal deleted inserted replaced
-1:000000000000 0:e35f40988205
       
     1 // Copyright (c) 2005-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 // This file contains methods allow to change XmlChar to TDesC
       
    15 // and TDesC to XmlChar
       
    16 //
       
    17 
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @publishedPartner
       
    23  @released
       
    24 */
       
    25 #ifndef XMLENGUTILS_H
       
    26 #define XMLENGUTILS_H
       
    27 
       
    28 #include <string.h>
       
    29 #include <e32base.h>
       
    30 
       
    31 /**
       
    32 Converts a xml string that may contains entities to a xml string
       
    33 with entity references, i.e. "t>x" -> "t&gt;x"
       
    34 
       
    35 @param aUnescapedString The string to escape
       
    36 @return The escaped string.  Ownership is transferred to the caller.  The
       
    37 returned string should be freed with free().
       
    38 @leave KErrNoMemory Memory allocation error
       
    39 @leave - Otherwise any other system wide error code
       
    40 */
       
    41 IMPORT_C char* XmlEngEscapeForXmlValueL(const char* aUnescapedString);
       
    42 
       
    43 /**
       
    44 Convert a UTF-16 descriptor into a UTF-8 zero-terminated string
       
    45 
       
    46 @param aDes The descriptor to convert
       
    47 @return The returned string.  Ownership is transferred to the caller.  The
       
    48 returned string should be freed with delete. 
       
    49 @leave KErrNoMemory Memory allocation error
       
    50 @leave - Otherwise any other system wide error code
       
    51 */
       
    52 IMPORT_C char* XmlEngXmlCharFromDesL(const TDesC& aDes);
       
    53 
       
    54 /**
       
    55 Convert a TDesC8 descriptor with UTF-8 characters into a UTF-8 zero-terminated
       
    56 string.
       
    57 
       
    58 @param aDes The descriptor to convert
       
    59 @return The returned string.  Ownership is transferred to the caller.  The
       
    60 returned string should be freed with delete.
       
    61 @leave KErrNoMemory Memory allocation error
       
    62 @leave - Otherwise any other system wide error code
       
    63 */
       
    64 IMPORT_C char* XmlEngXmlCharFromDes8L(const TDesC8& aDes);
       
    65 
       
    66 #endif // XMLENGUTILS_H
       
    67 
       
    68