class: exml::Element
Description:
Constructor and Destructor:
+ Element (void );
+ Element (const std::string & _value);
+ virtual ~Element (void );
Synopsis:
# std::vector<exml::Node*> m_listSub;
+ size_t size (void ) const;
+ void append (Node* _node);
+ enum nodeType getType (int32_t _id);
+ const enum nodeType getType (int32_t _id) const;
+ Node* getNode (int32_t _id);
+ const Node* getNode (int32_t _id) const;
+ Element* getElement (int32_t _id);
+ const Element* getElement (int32_t _id) const;
+ Element* getNamed (const std::string & _name);
+ const Element* getNamed (const std::string & _name) const;
+ std::string getText (void );
# bool subParse (const std::string & _data,
int32_t & _pos,
bool _caseSensitive,
exml::filePos & _filePos,
exml::Document & _doc,
bool _mainNode);
+ virtual enum nodeType getType (void ) const;
+ virtual bool iParse (const std::string & _data,
int32_t & _pos,
bool _caseSensitive,
exml::filePos & _filePos,
exml::Document & _doc);
+ virtual bool iGenerate (std::string & _data,
int32_t _indent) const;
+ virtual exml::Element* toElement (void );
+ virtual const exml::Element* toElement (void ) const;
+ virtual void clear (void );
Object Hierarchy:
+exml::Node
+--> +exml::AttributeList
+--> exml::Element
+--> exml::Document
Detail:
Element
+ Element (void );
Constructor
Element
+ Element (const std::string & _value);
Constructor
Parameter [input]: _value Element name;
~Element
+ virtual ~Element (void );
Destructor
m_listSub
# std::vector<exml::Node*> m_listSub;
size
+ size_t size (void ) const;
get the number of sub element in the node (can be exml::Comment ; exml::Element ; exml::Text :exml::Declaration).
Return: a number >=0.
append
+ void append (Node* _node);
add a node at the element (not exml::Attribute (move in the attribute automaticly).
Parameter [input]: _node Pointer of the node to add.
getType
+ enum nodeType getType (int32_t _id);
get the type of the element id.
Parameter [input]: _id Id of the element.
Return: the Current type of the element or exml::typeUnknow.
getType
+ const enum nodeType getType (int32_t _id) const;
get the node type.
Return: the type of the Node.
getNode
+ Node* getNode (int32_t _id);
get the Node pointer of the element id.
Parameter [input]: _id Id of the element.
Return: Pointer on node.
getNode
+ const Node* getNode (int32_t _id) const;
getElement
+ Element* getElement (int32_t _id);
get the element casted in Element (if the node is not an element return NULL).
Parameter [input]: _id Id of the element.
Return: Pointer on the element or NULL.
getElement
+ const Element* getElement (int32_t _id) const;
getNamed
+ Element* getNamed (const std::string & _name);
get an element with his name (work only with exml::Element)
Parameter [input]: _name Name of the element that is requested
Return: Pointer on the element or NULL.
getNamed
+ const Element* getNamed (const std::string & _name) const;
getText
+ std::string getText (void );
get the internal data of the element (if the element has some sub node thay are converted in xml string == > like this it is not needed to use <![CDATA[...]]>
Return: the curent data string.
subParse
# bool subParse (const std::string & _data,
int32_t & _pos,
bool _caseSensitive,
exml::filePos & _filePos,
exml::Document & _doc,
bool _mainNode);
getType
+ virtual enum nodeType getType (void ) const;
get the node type.
Return: the type of the Node.
iParse
+ virtual bool iParse (const std::string & _data,
int32_t & _pos,
bool _caseSensitive,
exml::filePos & _filePos,
exml::Document & _doc);
parse the Current node [pure VIRUAL]
Parameter [input]: _data data string to parse.
Parameter [input] [output]: _pos position in the string to start parse, return the position end of parsing.
Parameter [input]: _caseSensitive Request a parsion of element that is not case sensitive (all element is in low case)
Parameter [input] [output]: file parsing position (line x col x)
Return: false if an error occured.
iGenerate
+ virtual bool iGenerate (std::string & _data,
int32_t _indent) const;
generate a string with the tree of the xml
Parameter [input] [output]: _data string where to add the elements
Parameter [input]: current indentation of the file
Return: false if an error occured.
toElement
+ virtual exml::Element* toElement (void );
Cast the element in a Element if it is possible.
Return: pointer on the class or NULL.
toElement
+ virtual const exml::Element* toElement (void ) const;
Cast the element in a Element if it is possible.
Return: pointer on the class or NULL.
clear
+ virtual void clear (void );
clear the Node
+exml::Node
+--> +exml::AttributeList
+--> exml::Element
+--> exml::Document
Detail:
Element
+ Element (void );Constructor
Element
+ Element (const std::string & _value);Constructor
Parameter [input]: | _value | Element name; |
~Element
+ virtual ~Element (void );Destructor
m_listSub
# std::vector<exml::Node*> m_listSub;
size
+ size_t size (void ) const;get the number of sub element in the node (can be exml::Comment ; exml::Element ; exml::Text :exml::Declaration).
Return: | a number >=0. |
append
+ void append (Node* _node);add a node at the element (not exml::Attribute (move in the attribute automaticly).
Parameter [input]: | _node | Pointer of the node to add. |
getType
+ enum nodeType getType (int32_t _id);get the type of the element id.
Parameter [input]: | _id | Id of the element. |
Return: | the Current type of the element or exml::typeUnknow. |
getType
+ const enum nodeType getType (int32_t _id) const;get the node type.
Return: | the type of the Node. |
getNode
+ Node* getNode (int32_t _id);get the Node pointer of the element id.
Parameter [input]: | _id | Id of the element. |
Return: | Pointer on node. |
getNode
+ const Node* getNode (int32_t _id) const;
getElement
+ Element* getElement (int32_t _id);get the element casted in Element (if the node is not an element return NULL).
Parameter [input]: | _id | Id of the element. |
Return: | Pointer on the element or NULL. |
getElement
+ const Element* getElement (int32_t _id) const;
getNamed
+ Element* getNamed (const std::string & _name);get an element with his name (work only with exml::Element)
Parameter [input]: | _name | Name of the element that is requested |
Return: | Pointer on the element or NULL. |
getNamed
+ const Element* getNamed (const std::string & _name) const;
getText
+ std::string getText (void );get the internal data of the element (if the element has some sub node thay are converted in xml string == > like this it is not needed to use <![CDATA[...]]>
Return: | the curent data string. |
subParse
# bool subParse (const std::string & _data,
int32_t & _pos,
bool _caseSensitive,
exml::filePos & _filePos,
exml::Document & _doc,
bool _mainNode);
getType
+ virtual enum nodeType getType (void ) const;get the node type.
Return: | the type of the Node. |
iParse
+ virtual bool iParse (const std::string & _data,parse the Current node [pure VIRUAL]
int32_t & _pos,
bool _caseSensitive,
exml::filePos & _filePos,
exml::Document & _doc);
Parameter [input]: | _data | data string to parse. | Parameter [input] [output]: | _pos | position in the string to start parse, return the position end of parsing. | Parameter [input]: | _caseSensitive | Request a parsion of element that is not case sensitive (all element is in low case) | Parameter [input] [output]: | file | parsing position (line x col x) |
Return: | false if an error occured. |
iGenerate
+ virtual bool iGenerate (std::string & _data,generate a string with the tree of the xml
int32_t _indent) const;
Parameter [input] [output]: | _data | string where to add the elements | Parameter [input]: | current | indentation of the file |
Return: | false if an error occured. |
toElement
+ virtual exml::Element* toElement (void );Cast the element in a Element if it is possible.
Return: | pointer on the class or NULL. |
toElement
+ virtual const exml::Element* toElement (void ) const;Cast the element in a Element if it is possible.
Return: | pointer on the class or NULL. |
clear
+ virtual void clear (void );clear the Node