Logo ROOT  
Reference Guide
TXMLNode.h
Go to the documentation of this file.
1 // @(#)root/xmlparser:$Id$
2 // Author: Jose Lo 12/4/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TXMLNode
13 #define ROOT_TXMLNode
14 
15 #include "TObject.h"
16 
17 class TList;
18 struct _xmlNode;
19 
20 class TXMLNode : public TObject {
21 
22 private:
23  TXMLNode(const TXMLNode&) = delete;
24  TXMLNode& operator=(const TXMLNode&) = delete;
25 
26  _xmlNode *fXMLNode; ///< libxml node
27 
28  TXMLNode *fParent; ///< Parent node
29  TXMLNode *fChildren; ///< Children node
30  TXMLNode *fNextNode; ///< Next sibling node
31  TXMLNode *fPreviousNode; ///< Previous sibling node
32  TList *fAttrList; ///< List of Attributes
33 
34 public:
35  /// This enum is based on libxml tree Enum xmlElementType
41  };
42 
43  TXMLNode(_xmlNode *node, TXMLNode* parent=0, TXMLNode* previous=0);
44 
45  virtual ~TXMLNode();
46 
48  const char *GetNodeName() const;
50  TXMLNode *GetParent() const;
52  TXMLNode *GetPreviousNode() const;
53  const char *GetContent() const;
54  const char *GetText() const;
56 
57  Bool_t HasChildren() const;
58  Bool_t HasNextNode() const;
59  Bool_t HasParent() const;
60  Bool_t HasPreviousNode() const;
61  Bool_t HasAttributes() const;
62 
63  const char *GetNamespaceHref() const;
64  const char *GetNamespacePrefix() const;
65 
66  ClassDef(TXMLNode,0); // XML node under DOM tree
67 };
68 
69 #endif
TXMLNode::fPreviousNode
TXMLNode * fPreviousNode
Previous sibling node.
Definition: TXMLNode.h:31
TXMLNode::HasPreviousNode
Bool_t HasPreviousNode() const
Returns true if has previous node.
Definition: TXMLNode.cxx:190
TXMLNode::GetContent
const char * GetContent() const
Returns the content if any, or 0.
Definition: TXMLNode.cxx:97
TXMLNode::GetChildren
TXMLNode * GetChildren()
Returns the node's child if any, returns 0 if no child.
Definition: TXMLNode.cxx:74
TXMLNode::fXMLNode
_xmlNode * fXMLNode
libxml node
Definition: TXMLNode.h:26
TXMLNode::GetText
const char * GetText() const
Returns the content of a Text node if node is a TextNode, 0 otherwise.
Definition: TXMLNode.cxx:154
TXMLNode::TXMLNode
TXMLNode(const TXMLNode &)=delete
TXMLNode::fAttrList
TList * fAttrList
List of Attributes.
Definition: TXMLNode.h:32
TXMLNode::HasChildren
Bool_t HasChildren() const
Returns true if node has children.
Definition: TXMLNode.cxx:166
TXMLNode::GetParent
TXMLNode * GetParent() const
Returns the node's parent if any, returns 0 if no parent.
Definition: TXMLNode.cxx:89
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TXMLNode
Definition: TXMLNode.h:20
TXMLNode::HasParent
Bool_t HasParent() const
Returns true if node has parent.
Definition: TXMLNode.cxx:182
TXMLNode::kXMLCommentNode
@ kXMLCommentNode
Definition: TXMLNode.h:40
TXMLNode::EXMLElementType
EXMLElementType
This enum is based on libxml tree Enum xmlElementType.
Definition: TXMLNode.h:36
TXMLNode::fChildren
TXMLNode * fChildren
Children node.
Definition: TXMLNode.h:29
TXMLNode::kXMLElementNode
@ kXMLElementNode
Definition: TXMLNode.h:37
TXMLNode::fParent
TXMLNode * fParent
Parent node.
Definition: TXMLNode.h:28
TXMLNode::HasAttributes
Bool_t HasAttributes() const
Returns true if Element node has attribute.
Definition: TXMLNode.cxx:198
TXMLNode::GetNamespacePrefix
const char * GetNamespacePrefix() const
Returns prefix for the namespace, or 0 if no namespace.
Definition: TXMLNode.cxx:217
TXMLNode::~TXMLNode
virtual ~TXMLNode()
Destructor.
Definition: TXMLNode.cxx:45
TXMLNode::HasNextNode
Bool_t HasNextNode() const
Returns true if has next node.
Definition: TXMLNode.cxx:174
TXMLNode::kXMLAttributeNode
@ kXMLAttributeNode
Definition: TXMLNode.h:38
TXMLNode::GetNamespaceHref
const char * GetNamespaceHref() const
Returns the URL for the namespace, or 0 if no namespace.
Definition: TXMLNode.cxx:206
TXMLNode::fNextNode
TXMLNode * fNextNode
Next sibling node.
Definition: TXMLNode.h:30
TXMLNode::GetNextNode
TXMLNode * GetNextNode()
Returns the next sibling XMLNode in the DOM tree, if any return 0 if no next node.
Definition: TXMLNode.cxx:130
TObject.h
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TXMLNode::kXMLTextNode
@ kXMLTextNode
Definition: TXMLNode.h:39
TXMLNode::GetNodeName
const char * GetNodeName() const
Returns the node's name.
Definition: TXMLNode.cxx:66
TXMLNode::GetPreviousNode
TXMLNode * GetPreviousNode() const
Returns the previous sibling XMLNode in the DOM tree, if any return 0 if no previous node.
Definition: TXMLNode.cxx:146
TXMLNode::operator=
TXMLNode & operator=(const TXMLNode &)=delete
TXMLNode::GetAttributes
TList * GetAttributes()
Returns a list of node's attribute if any, returns 0 if no attribute.
Definition: TXMLNode.cxx:108
TXMLNode::GetNodeType
EXMLElementType GetNodeType() const
Returns the node's type.
Definition: TXMLNode.cxx:58
TList
Definition: TList.h:44