2 * Copyright (c) 2004-2005 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Node functions implementation
24 inline TXmlEngNode::TXmlEngNode()
27 inline TXmlEngNode::TXmlEngNode(void* aInternal)
28 : iInternal(aInternal) {}
30 inline TBool TXmlEngNode::IsNull() const
31 {return iInternal == NULL;}
33 inline TBool TXmlEngNode::NotNull() const
34 {return iInternal != NULL;}
36 // ------------------------------------------------------------------------
39 // The nodes are the same if they are referring to the same in-memory
41 // ------------------------------------------------------------------------
43 inline TBool TXmlEngNode::IsSameNode(TXmlEngNode aOther) const
44 {return iInternal == aOther.iInternal;}
46 // ------------------------------------------------------------------------
47 // Moves the node to another part of the tree or another document
48 // The node is unliked from current postion (if any) and appended
49 // to the its new parent.
52 // In many cases this method call should be followed by ReconcileNamespacesL() on the moved node
53 // ------------------------------------------------------------------------
55 inline TXmlEngNode TXmlEngNode::MoveTo(TXmlEngNode aParent)
56 {return aParent.AppendChildL(Unlink());}
58 inline TXmlEngAttr& TXmlEngNode::AsAttr() const
59 {return *reinterpret_cast<TXmlEngAttr*>(const_cast<TXmlEngNode*>(this));}
61 inline TXmlEngElement& TXmlEngNode::AsElement() const
62 {return *reinterpret_cast<TXmlEngElement*>(const_cast<TXmlEngNode*>(this));}
64 inline TXmlEngTextNode& TXmlEngNode::AsText() const
65 {return *reinterpret_cast<TXmlEngTextNode*>(const_cast<TXmlEngNode*>(this));}
67 inline TXmlEngBinaryContainer& TXmlEngNode::AsBinaryContainer() const
68 {return *reinterpret_cast<TXmlEngBinaryContainer*>(const_cast<TXmlEngNode*>(this));}
70 inline TXmlEngChunkContainer& TXmlEngNode::AsChunkContainer() const
71 {return *reinterpret_cast<TXmlEngChunkContainer*>(const_cast<TXmlEngNode*>(this));}
73 inline TXmlEngFileContainer& TXmlEngNode::AsFileContainer() const
74 {return *reinterpret_cast<TXmlEngFileContainer*>(const_cast<TXmlEngNode*>(this));}
76 inline TXmlEngDataContainer& TXmlEngNode::AsDataContainer() const
77 {return *reinterpret_cast<TXmlEngDataContainer*>(const_cast<TXmlEngNode*>(this));}
79 inline TXmlEngNamespace& TXmlEngNode::AsNamespace() const
80 {return *reinterpret_cast<TXmlEngNamespace*>(const_cast<TXmlEngNode*>(this));}
82 inline TXmlEngComment& TXmlEngNode::AsComment() const
83 {return *reinterpret_cast<TXmlEngComment*>(const_cast<TXmlEngNode*>(this));}
85 inline TXmlEngCDATASection& TXmlEngNode::AsCDATASection() const
86 {return *reinterpret_cast<TXmlEngCDATASection*>(const_cast<TXmlEngNode*>(this));}
89 inline TXmlEngEntityReference& TXmlEngNode::AsEntityReference() const
90 {return *reinterpret_cast<TXmlEngEntityReference*>(const_cast<TXmlEngNode*>(this));}
92 inline TXmlEngProcessingInstruction& TXmlEngNode::AsProcessingInstruction() const
93 {return *reinterpret_cast<TXmlEngProcessingInstruction*>(const_cast<TXmlEngNode*>(this));}