xml/xmldomandxpath/src/xmlenginedom/xmlengdomdefs.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 // Declaration of macros used in DOM and XPath
       
    15 //
       
    16 
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22  @released
       
    23 */
       
    24 #ifndef XMLENGDOMDEFS_H
       
    25 #define XMLENGDOMDEFS_H
       
    26 
       
    27 #include <stdapis/libxml2/libxml2_parser.h>
       
    28 #include <xml/utils/xmlengxestd.h>
       
    29 #include <xml/utils/xmlengmem.h>
       
    30 #include <xml/dom/xmlengerrors.h>
       
    31 
       
    32 // warning C4238: nonstandard extension used : class rvalue used as lvalue
       
    33 // it happens often during casts or passing non-variable arguments to methods expecting a non-const reference
       
    34 //#pragma warning(disable: 4238)
       
    35 
       
    36 #define INTERNAL_NODEPTR(aNodeObject)   (*reinterpret_cast<xmlNodePtr*>(&(aNodeObject)))
       
    37 #define INTERNAL_ATTRPTR(aAttrObject)   (*reinterpret_cast<xmlAttrPtr*>(&(aAttrObject)))
       
    38 #define INTERNAL_NSPTR(aNsDefObject)    (*reinterpret_cast<xmlNsPtr*>(&(aNsDefObject)))
       
    39 #define INTERNAL_DOCPTR(aDocObject)     (*reinterpret_cast<xmlDocPtr*>(&(aDocObject)))
       
    40 #define INTERNAL_NODESETPTR(aSetObj) \
       
    41            (*reinterpret_cast<xmlNodeSetPtr*>(const_cast<RXmlEngNodeSet*>(&(aSetObj))))
       
    42 #define INTERNAL_XPATHOBJPTR(aObj) \
       
    43            (*reinterpret_cast<xmlXPathObjectPtr*>(const_cast<RXmlEngXPathResult*>(&(aObj))))
       
    44 #define LIBXML_NODE (static_cast<xmlNodePtr>(iInternal))
       
    45 #define CAST_DOMSTRING_TO_XMLCHAR(domstring) \
       
    46            (reinterpret_cast<const xmlChar*>(domstring.Cstring()))
       
    47 #define CAST_XMLCHAR_TO_DOMSTRING(libxmlString) \
       
    48 		(TXmlEngConstString(reinterpret_cast<const char*>(libxmlString)))
       
    49 #define CAST_XMLCHAR_TO_STRING(libxmlString) \
       
    50 		(TXmlEngString(reinterpret_cast<char*>(libxmlString)))
       
    51 #define CAST_NODELIST_REF(List) ((TXmlEngNodeListImpl&)(List))
       
    52 
       
    53 #define TDOMNODETYPENONE ((TXmlEngDOMNodeType)0)
       
    54 //data container type is stored in psvi field of text node
       
    55 #define TEXT_NODE_DATA_TYPE LIBXML_NODE->psvi
       
    56 
       
    57 #define WRONG_USE_OF_API    XmlEngLeaveL(KXmlEngErrWrongUseOfAPI)
       
    58 #define XE_ASSERT_DEBUG(assertion)  __ASSERT_DEBUG((assertion),  XmlEngLeaveL(KXmlEngErrWrongUseOfAPI))
       
    59 #define XE_ASSERT_ALWAYS(assertion) __ASSERT_ALWAYS((assertion), XmlEngLeaveL(KXmlEngErrNullNode))
       
    60 
       
    61 void SetUserDataCallbacks();
       
    62 
       
    63 xmlChar* xmlCharFromDesC8L(const TDesC8& aDesc);
       
    64 
       
    65 void xmlCharAssignToRbuf8L(RBuf8& aOutput,xmlChar *text);
       
    66 
       
    67 #endif /* XMLENGDOMDEFS_H */