Gazebo

XMLConfigNode Class Reference
[Server]

#include <XMLConfig.hh>

List of all members.


Detailed Description

Class encapsulating a single xml node.


Public Member Functions

 XMLConfigNode (XMLConfig *cfg, XMLConfigNode *parent, xmlNodePtr xmlNode, xmlDocPtr xmlDoc)
 Constructor.
 ~XMLConfigNode ()
 Destructors.
std::string GetName ()
 Get the node name.
std::string GetNSPrefix ()
 Get the name space prefix.
XMLConfigNodeGetNext ()
 Get the next sibling of this node.
XMLConfigNodeGetNext (const std::string &name, const std::string &prefix=std::string())
 Get next by name.
XMLConfigNodeGetNextByNSPrefix (const std::string &prefix)
 Get next node by namespace prefix.
XMLConfigNodeGetChild ()
 Get the first child of this node.
XMLConfigNodeGetChild (const std::string &name, const std::string &prefix=std::string())
 Get a child based on a name. Returns null if not found.
XMLConfigNodeGetChildByNSPrefix (const std::string &prefix)
 Get the first child with the specified namespace prefix.
XMLConfigNodeRewind ()
 Move child pointer back to beginning.
void Print ()
 Print (for debugging purposes).
std::string GetValue ()
 Return the value of the current node.
std::string GetString (const std::string &key, const std::string &def, int require=0)
 Get an attribute string value.
unsigned char GetChar (const std::string &key, char def, int require=0)
 Get a attribute character value.
std::string GetFilename (const std::string &key, const std::string &def, int require=0)
 Get a file name.
int GetInt (const std::string &key, int def, int require=0)
 Get an integer.
double GetDouble (const std::string &key, double def, int require=0)
 Get a double.
float GetFloat (const std::string &key, float def, int require=0)
 Get a float.
bool GetBool (const std::string &key, bool def, int require=0)
 Get a boolean.
double GetLength (const std::string &key, double def, int require=0)
 Get an attribute length value (return value in meters).
gazebo::Time GetTime (const std::string &key, double def, int require=0)
 Get an attribute time value (return value in seconds).
Vector3 GetVector3 (const std::string &key, Vector3 def)
 Get a position.
Vector2< double > GetVector2d (const std::string &key, Vector2< double > def)
 Get a two dimensional double vector.
Vector2< int > GetVector2i (const std::string &key, Vector2< int > def)
 Get a two dimensional int vector.
Quatern GetRotation (const std::string &key, Quatern def)
 Get a rotation.
std::string GetTupleString (const std::string &key, int index, const std::string &def)
 Get an attribute tuple value.
int GetTupleInt (const std::string &key, int index, int def)
 Get an attribute tuple int value.
double GetTupleDouble (const std::string &key, int index, double def)
 Get an attribute tuple double value.
double GetTupleLength (const std::string &key, int index, double def)
 Get an attribute tuple length value (return value in meters).
double GetTupleAngle (const std::string &key, int index, double def)
 Get an attribute tuple angle value (return value in radians).
void SetValue (const std::string &key, const StringValue &data, int require=0, int type=0)
 Set a node's value, either attribute or child node value, maybe create it.

Protected Member Functions

xmlChar * GetNodeValue (const std::string &key)
 Get a node's value, which is either a attribute or child node value.
bool SetNodeValue (const std::string &key, const std::string &value)
 Set a node's value, either attribute or child node value (private).
void NewNode (const char *key, const char *value, int type)
 Creates a new node child of this. either attribute or element.


Member Function Documentation

std::string GetFilename ( const std::string &  key,
const std::string &  def,
int  require = 0 
)

Get a file name.

Always returns an absolute path. If the filename is entered as a relative path, we prepend the world file path.

void SetValue ( const std::string &  key,
const StringValue &  data,
int  require = 0,
int  type = 0 
)

Set a node's value, either attribute or child node value, maybe create it.

Parameters:
key : the name of the element or attribute to write
value : the name of the element or attribute to write
require : Require=1 means that if not found a new node will be created
type : Only if a new node is created, the type must be specified


The documentation for this class was generated from the following file:

Last updated Aug 04 2007