diff -r 000000000000 -r e35f40988205 xml/xmldomandxpath/src/xmlenginedom/xmlengdomdefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/xmldomandxpath/src/xmlenginedom/xmlengdomdefs.h Thu Dec 17 09:29:21 2009 +0200 @@ -0,0 +1,67 @@ +// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// Declaration of macros used in DOM and XPath +// + + + +/** + @file + @internalComponent + @released +*/ +#ifndef XMLENGDOMDEFS_H +#define XMLENGDOMDEFS_H + +#include +#include +#include +#include + +// warning C4238: nonstandard extension used : class rvalue used as lvalue +// it happens often during casts or passing non-variable arguments to methods expecting a non-const reference +//#pragma warning(disable: 4238) + +#define INTERNAL_NODEPTR(aNodeObject) (*reinterpret_cast(&(aNodeObject))) +#define INTERNAL_ATTRPTR(aAttrObject) (*reinterpret_cast(&(aAttrObject))) +#define INTERNAL_NSPTR(aNsDefObject) (*reinterpret_cast(&(aNsDefObject))) +#define INTERNAL_DOCPTR(aDocObject) (*reinterpret_cast(&(aDocObject))) +#define INTERNAL_NODESETPTR(aSetObj) \ + (*reinterpret_cast(const_cast(&(aSetObj)))) +#define INTERNAL_XPATHOBJPTR(aObj) \ + (*reinterpret_cast(const_cast(&(aObj)))) +#define LIBXML_NODE (static_cast(iInternal)) +#define CAST_DOMSTRING_TO_XMLCHAR(domstring) \ + (reinterpret_cast(domstring.Cstring())) +#define CAST_XMLCHAR_TO_DOMSTRING(libxmlString) \ + (TXmlEngConstString(reinterpret_cast(libxmlString))) +#define CAST_XMLCHAR_TO_STRING(libxmlString) \ + (TXmlEngString(reinterpret_cast(libxmlString))) +#define CAST_NODELIST_REF(List) ((TXmlEngNodeListImpl&)(List)) + +#define TDOMNODETYPENONE ((TXmlEngDOMNodeType)0) +//data container type is stored in psvi field of text node +#define TEXT_NODE_DATA_TYPE LIBXML_NODE->psvi + +#define WRONG_USE_OF_API XmlEngLeaveL(KXmlEngErrWrongUseOfAPI) +#define XE_ASSERT_DEBUG(assertion) __ASSERT_DEBUG((assertion), XmlEngLeaveL(KXmlEngErrWrongUseOfAPI)) +#define XE_ASSERT_ALWAYS(assertion) __ASSERT_ALWAYS((assertion), XmlEngLeaveL(KXmlEngErrNullNode)) + +void SetUserDataCallbacks(); + +xmlChar* xmlCharFromDesC8L(const TDesC8& aDesc); + +void xmlCharAssignToRbuf8L(RBuf8& aOutput,xmlChar *text); + +#endif /* XMLENGDOMDEFS_H */