/ styx_dom.hh / Objects / StyxDomNode / Public Methods / Description

Public Methods



getRoot

StyxDomNode*		getRoot(void);
Return the older grand-parent node of this node.

Result: A pointer to a StyxDomNode..


getParent

StyxDomNode*		getParent(void);
Return the closer parent of this node.

Result: A pointer to a StyxDomNode..


getFirstChild

StyxDomNode*		getFirstChild(void);
Return a pointer to the first child node of this node.

Result: A pointer to a StyxDomNode..


getLastChild

StyxDomNode*		getLastChild(void);
Return a pointer to the last child node of this node.

Result: A pointer to a StyxDomNode..


nextSibling

StyxDomNode*		nextSibling(void);
Return a pointer to the next sibling node of this node.

Result: A pointer to a StyxDomNode..


prevSibling

StyxDomNode*		prevSibling(void);
Return a pointer to the previous sibling node of this node.

Result: A pointer to a StyxDomNode..


getName

string		getName(void);
Return the name of this node.

Result: Name string..


getValue

string		getValue(void);
Return the value of this node.

Result: Value string..


setValue

void			setValue(string value);
Change the value string of this node.

Parameters
value The new value string.


getType

DomNodeType		getType(void);
Return the type of the node.

Result: A DomNodeType value..


getComplete

bool			getComplete(void);
Return the complete state of this node. If the value is false, the tag isn't closed.

Result: The current complete state..


setComplete

void			setComplete(bool complete);
Change the value of the complete state of this node. When set to true, the node is considerate closed.

Parameters
complete The new complete state.


getNextAttribute

StyxDomNode*		getNextAttribute(void);
Return the next attribute of this node.

Result: A pointer to a StyxDomNode..


addAttribute

StyxDomNode*		addAttribute(string name, string value);
Add an attribute node to the attribute's list of this node.

Parameters
name Name of the new attribute.
value Value of the new attribute.

Result: A pointer to the created StyxDomNode..


addText

StyxDomNode*		addText(string text);
Add a text node to the child's list of this node.

Parameters
text The text string of the new node.

Result: A pointer to the created StyxDomNode..


addNextNode

void			addNextNode(StyxDomNode* node);
Add an existing node as last sibling of this node.

Parameters
node Previously created node which must be added.


addChildNode

void			addChildNode(StyxDomNode* node);
Add an existing node as last child of this node.

Parameters
node Previously created node which must be added.


addNamespace

void			addNamespace(string name, string uri);
Add a namespace attribute to this node.

Parameters
name Name of the new namespace.
uri Universal ressource identifier of the namespace.


setNamespace

void			setNamespace(StyxDomNode* ancestor);
Search from the given ancestor the namespace which match the name of this node, and set the namespace of it.

Parameters
ancestor The node where the searching begins. If set to NULL, the searching begins with this node.


writeDom

void			writeDom(FILE* file, int nbTab);
Write this representation of this node to the given file.

Parameters
file Stream where the node will be written.
nbTab Number of tabulations at the beginning of the tag.


getDescendants

vector	getDescendants(void);
Return all descendants of this node.

Result: Array of pointers to StyxDomNode..


getDescendantsOrSelf

vector	getDescendantsOrSelf(void);
Return all descendants of this node, plus this node itself.

Result: Array of pointers to StyxDomNode..


getAttributes

vector	getAttributes(string attrName);
Return all matching attributes of this node.

Parameters
attrName Name of searched attributes. If set to an empty string, all attributes will be returned.

Result: Array of pointers to StyxDomNode..


getChilds

vector	getChilds(string childName);
Return all matching childs of this node.

Parameters
childName Name of searched childs. If set to an empty string, all childs will be returned.

Result: Array of pointers to StyxDomNode..


StyxDomNode

StyxDomNode(DomNodeType type, string name, string value, bool isComplete)
Constructor


~StyxDomNode

~StyxDomNode(void)
Destructor