LRAUV  revA
MissionNode.h
Go to the documentation of this file.
1 
10 #ifndef MISSIONNODE_H_
11 #define MISSIONNODE_H_
12 
13 class TiXmlNode;
14 
21 {
22 public:
23 
24  MissionNode( const char* rootName );
25 
26  virtual ~MissionNode();
27 
28  const char* getName();
29 
30  const char* getTextValue();
31 
32  bool hasChildNodes();
33 
34  MissionNode* getChild( const char* name );
35 
36  MissionNode* getFirstChild( bool ignoreTextNodes = true );
37 
38  MissionNode* getNextSibling( bool ignoreTextNodes = true );
39 
40  bool hasAttribute( const char* name );
41 
42  const char* getAttribute( const char* name );
43 
44  bool isElement();
45 
46  bool isText();
47 
48  const char* getAttribute( const char* name, int& writeTo );
49 
50  const char* getAttribute( const char* name, double& writeTo );
51 
52  bool setAttribute( const char* name, const char* value );
53 
54  bool setAttribute( const char* name, const int value );
55 
56  bool setAttribute( const char* name, const double value );
57 
58  const char* getChildTextValue();
59 
60  void setName( const char* name );
61 
62  MissionNode* appendChild( const char* name );
63 
64  MissionNode* appendChildText( const char* text );
65 
66  MissionNode* insertChildBefore( MissionNode* insertBefore, const char* name );
67 
68  MissionNode* insertChildAfter( MissionNode* insertAfter, const char* name );
69 
70  void holdNode( MissionNode* node )
71  {
72  heldNode_ = node;
73  }
74 
75  // Print out the document as xml.
76  // Only possible from the root node.
77  void debugPrint();
78 
79 protected:
80 
81  MissionNode( TiXmlNode* xmlNode );
82 
83  TiXmlNode* xmlNode_;
84 
86 
87 private:
88  // Note that the copy constructor below is private and not given a body.
89  // Any attempt to call it will return a compiler error.
90  MissionNode( const MissionNode& old ); // disallow copy constructor
91 
92 };
93 
94 #endif /* MISSIONNODE_H_ */
MissionNode * appendChildText(const char *text)
Definition: MissionNode.cpp:227
bool setAttribute(const char *name, const char *value)
Definition: MissionNode.cpp:168
MissionNode * getNextSibling(bool ignoreTextNodes=true)
Definition: MissionNode.cpp:99
void holdNode(MissionNode *node)
Definition: MissionNode.h:70
const char * getName()
Definition: MissionNode.cpp:54
MissionNode(const char *rootName)
Definition: MissionNode.cpp:14
const char * getTextValue()
Definition: MissionNode.cpp:59
MissionNode * getChild(const char *name)
Definition: MissionNode.cpp:69
const char * getAttribute(const char *name)
Definition: MissionNode.cpp:135
bool isElement()
Definition: MissionNode.cpp:114
TiXmlNode * xmlNode_
Definition: MissionNode.h:83
MissionNode * insertChildAfter(MissionNode *insertAfter, const char *name)
Definition: MissionNode.cpp:247
MissionNode * insertChildBefore(MissionNode *insertBefore, const char *name)
Definition: MissionNode.cpp:234
bool hasAttribute(const char *name)
Definition: MissionNode.cpp:124
Wraps a TiXmlNode.
Definition: MissionNode.h:20
MissionNode * getFirstChild(bool ignoreTextNodes=true)
Definition: MissionNode.cpp:84
virtual ~MissionNode()
Definition: MissionNode.cpp:21
MissionNode * appendChild(const char *name)
Definition: MissionNode.cpp:219
bool hasChildNodes()
Definition: MissionNode.cpp:64
void setName(const char *name)
Definition: MissionNode.cpp:214
const char * getChildTextValue()
Definition: MissionNode.cpp:204
MissionNode * heldNode_
Definition: MissionNode.h:85
bool isText()
Definition: MissionNode.cpp:119
void debugPrint()
Definition: MissionNode.cpp:260