Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

indri::xml::XMLNode Class Reference

#include <XMLNode.hpp>

List of all members.

Public Types

typedef std::map< std::string,
std::string > 
MAttributes

Public Member Functions

 XMLNode (const std::string &name)
 XMLNode (const std::string &name, const std::string &value)
 XMLNode (const std::string &name, const MAttributes &attributes)
 XMLNode (const std::string &name, const MAttributes &attributes, const std::string &value)
 ~XMLNode ()
 clean up

void addChild (XMLNode *child)
void addAttribute (const std::string &key, const std::string &value)
void setValue (const std::string &value)
const std::string & getName () const
 the name of this node

const std::string & getValue () const
 the value of this node

const MAttributesgetAttributes () const
 the attributes of this node

std::string getAttribute (const std::string &name) const
const std::vector< XMLNode * > & getChildren () const
const XMLNodegetChild (const std::string &name) const
std::string getChildValue (const std::string &name) const

Private Attributes

std::string _name
MAttributes _attributes
std::vector< XMLNode * > _children
std::string _value


Detailed Description

Internal Representation of an XML node hierarchy.


Member Typedef Documentation

typedef std::map<std::string,std::string> indri::xml::XMLNode::MAttributes
 


Constructor & Destructor Documentation

indri::xml::XMLNode::XMLNode const std::string &  name  ) 
 

Create a node with the given name

Parameters:
name the name for the node.

indri::xml::XMLNode::XMLNode const std::string &  name,
const std::string &  value
 

Create a node with the given name and value

Parameters:
name the name for the node.
value the value for the node

indri::xml::XMLNode::XMLNode const std::string &  name,
const MAttributes attributes
 

Create a node with the given name and value

Parameters:
name the name for the node.
attributes the map constituting the value for the node

indri::xml::XMLNode::XMLNode const std::string &  name,
const MAttributes attributes,
const std::string &  value
 

Create a node with the given name and value

Parameters:
name the name for the node.
attributes the map constituting the value for the node
value the string value for the node.

indri::xml::XMLNode::~XMLNode  ) 
 

clean up


Member Function Documentation

void indri::xml::XMLNode::addAttribute const std::string &  key,
const std::string &  value
 

Add an attribute to this node.

Parameters:
key the key for the parameter
value the value for the parameter

void indri::xml::XMLNode::addChild XMLNode child  ) 
 

Add a child to this node.

Parameters:
child the child to add

std::string indri::xml::XMLNode::getAttribute const std::string &  name  )  const
 

Get the named attribute value

Parameters:
name the key
Returns:
the value

const indri::xml::XMLNode::MAttributes & indri::xml::XMLNode::getAttributes  )  const
 

the attributes of this node

const indri::xml::XMLNode * indri::xml::XMLNode::getChild const std::string &  name  )  const
 

Get the named child of this node.

Parameters:
name the key
Returns:
the named child node

const std::vector< indri::xml::XMLNode * > & indri::xml::XMLNode::getChildren  )  const
 

Get the children of this node

Returns:
the vector of child node pointers.

std::string indri::xml::XMLNode::getChildValue const std::string &  name  )  const
 

Get the value of the named child of this node.

Parameters:
name the key
Returns:
the value of the named child node

const std::string & indri::xml::XMLNode::getName  )  const
 

the name of this node

const std::string & indri::xml::XMLNode::getValue  )  const
 

the value of this node

void indri::xml::XMLNode::setValue const std::string &  value  ) 
 

Set the value of this node

Parameters:
value the new value


Member Data Documentation

MAttributes indri::xml::XMLNode::_attributes [private]
 

std::vector<XMLNode*> indri::xml::XMLNode::_children [private]
 

std::string indri::xml::XMLNode::_name [private]
 

std::string indri::xml::XMLNode::_value [private]
 


The documentation for this class was generated from the following files:
Generated on Tue Jun 15 11:03:04 2010 for Lemur by doxygen 1.3.4