class: exml::Node
Description:
Constructor and Destructor:
+ Node (void );
+ Node (const std::string & _value);
+ virtual ~Node (void );
Synopsis:
+ virtual bool iParse (const std::string & _data,
int32_t & _pos,
bool _caseSensitive,
exml::filePos & _filePos,
exml::Document & _doc) = 0;
+ virtual bool iGenerate (std::string & _data,
int32_t _indent) const;
# exml::filePos m_pos;
+ const exml::filePos & getPos (void );
# std::string m_value;
+ virtual void setValue (std::string _value);
+ virtual const std::string & getValue (void ) const;
+ virtual enum nodeType getType (void ) const;
# void addIndent (std::string & _data,
int32_t _indent) const;
# void drawElementParsed (char32_t _val,
const exml::filePos & _filePos) const;
# bool checkAvaillable (char32_t _val,
bool _firstChar) const;
# int32_t countWhiteChar (const std::string & _data,
int32_t _pos,
exml::filePos & _filePos) const;
+ virtual exml::Document* toDocument (void );
+ virtual const exml::Document* toDocument (void ) const;
+ virtual exml::Attribute* toAttribute (void );
+ virtual const exml::Attribute* toAttribute (void ) const;
+ virtual exml::Comment* toComment (void );
+ virtual const exml::Comment* toComment (void ) const;
+ virtual exml::Declaration* toDeclaration (void );
+ virtual const exml::Declaration* toDeclaration (void ) const;
+ virtual exml::Element* toElement (void );
+ virtual const exml::Element* toElement (void ) const;
+ virtual exml::Text* toText (void );
+ virtual const exml::Text* toText (void ) const;
+ bool isDocument (void ) const;
+ bool isAttribute (void ) const;
+ bool isComment (void ) const;
+ bool isDeclaration (void ) const;
+ bool isElement (void ) const;
+ bool isText (void ) const;
+ virtual void clear (void );
Object Hierarchy:
exml::Node
+--> exml::Comment
+--> exml::Attribute
+--> exml::Text
+--> exml::AttributeList
Detail:
Node
+ Node (void );
basic element of a xml structure
Node
+ Node (const std::string & _value);
basic element of a xml structure
Parameter [input]: value of the node
~Node
+ virtual ~Node (void );
destructor
iParse
+ virtual bool iParse (const std::string & _data,
int32_t & _pos,
bool _caseSensitive,
exml::filePos & _filePos,
exml::Document & _doc) = 0;
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.
m_pos
# exml::filePos m_pos;
position in the readed file == > not correct when the file is generated
getPos
+ const exml::filePos & getPos (void );
get the current position where the element is in the file
m_value
# std::string m_value;
value of the node (for element this is the name, for text it is the inside text ...)
setValue
+ virtual void setValue (std::string _value);
set the value of the node.
Parameter [input]: _value New value of the node.
getValue
+ virtual const std::string & getValue (void ) const;
get the current element Value.
Return: the reference of the string value.
getType
+ virtual enum nodeType getType (void ) const;
get the node type.
Return: the type of the Node.
addIndent
# void addIndent (std::string & _data,
int32_t _indent) const;
add indentation of the string input.
Parameter [input] [output]: _data String where the indentation is done.
Parameter [input]: _indent Number of tab to add at the string.
drawElementParsed
# void drawElementParsed (char32_t _val,
const exml::filePos & _filePos) const;
Display the cuurent element that is curently parse.
Parameter [input]: _val Char that is parsed.
Parameter [input]: _filePos Position of the char in the file.
checkAvaillable
# bool checkAvaillable (char32_t _val,
bool _firstChar) const;
check if an element or attribute is availlable (not : !"#$%&'()+,/;<=>?@[\]^`{|}~ \n\t\r and for first char : not -.0123456789).
Parameter [input]: _val Value to check the conformity.
Parameter [input]: _firstChar True if the element check is the first char.
countWhiteChar
# int32_t countWhiteChar (const std::string & _data,
int32_t _pos,
exml::filePos & _filePos) const;
count the number of white char in the string from the specify position (stop at the first element that is not a white char)
Parameter [input]: _data Data to parse.
Parameter [input]: _pos Start position in the string.
Parameter [output]: _filePos new poistion of te file to add.
Return: number of white element.
toDocument
+ virtual exml::Document* toDocument (void );
Cast the element in a Document if it is possible.
Return: pointer on the class or NULL.
toDocument
+ virtual const exml::Document* toDocument (void ) const;
toAttribute
+ virtual exml::Attribute* toAttribute (void );
Cast the element in a Attribute if it is possible.
Return: pointer on the class or NULL.
toAttribute
+ virtual const exml::Attribute* toAttribute (void ) const;
toComment
+ virtual exml::Comment* toComment (void );
Cast the element in a Comment if it is possible.
Return: pointer on the class or NULL.
toComment
+ virtual const exml::Comment* toComment (void ) const;
toDeclaration
+ virtual exml::Declaration* toDeclaration (void );
Cast the element in a Declaration if it is possible.
Return: pointer on the class or NULL.
toDeclaration
+ virtual const exml::Declaration* toDeclaration (void ) const;
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;
toText
+ virtual exml::Text* toText (void );
Cast the element in a Text if it is possible.
Return: pointer on the class or NULL.
toText
+ virtual const exml::Text* toText (void ) const;
isDocument
+ bool isDocument (void ) const;
check if the node is a exml::Document
Return: true if the node is a exml::Document
isAttribute
+ bool isAttribute (void ) const;
check if the node is a exml::Attribute
Return: true if the node is a exml::Attribute
isComment
+ bool isComment (void ) const;
check if the node is a exml::Comment
Return: true if the node is a exml::Comment
isDeclaration
+ bool isDeclaration (void ) const;
check if the node is a exml::Declaration
Return: true if the node is a exml::Declaration
isElement
+ bool isElement (void ) const;
check if the node is a exml::Element
Return: true if the node is a exml::Element
isText
+ bool isText (void ) const;
check if the node is a exml::Text
Return: true if the node is a exml::Text
clear
+ virtual void clear (void );
clear the Node
exml::Node
+--> exml::Comment
+--> exml::Attribute
+--> exml::Text
+--> exml::AttributeList
Detail:
Node
+ Node (void );basic element of a xml structure
Node
+ Node (const std::string & _value);basic element of a xml structure
Parameter [input]: | value | of the node |
~Node
+ virtual ~Node (void );destructor
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) = 0;
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. |
m_pos
# exml::filePos m_pos;position in the readed file == > not correct when the file is generated
getPos
+ const exml::filePos & getPos (void );get the current position where the element is in the file
m_value
# std::string m_value;value of the node (for element this is the name, for text it is the inside text ...)
setValue
+ virtual void setValue (std::string _value);set the value of the node.
Parameter [input]: | _value | New value of the node. |
getValue
+ virtual const std::string & getValue (void ) const;get the current element Value.
Return: | the reference of the string value. |
getType
+ virtual enum nodeType getType (void ) const;get the node type.
Return: | the type of the Node. |
addIndent
# void addIndent (std::string & _data,add indentation of the string input.
int32_t _indent) const;
Parameter [input] [output]: | _data | String where the indentation is done. | Parameter [input]: | _indent | Number of tab to add at the string. |
drawElementParsed
# void drawElementParsed (char32_t _val,Display the cuurent element that is curently parse.
const exml::filePos & _filePos) const;
Parameter [input]: | _val | Char that is parsed. | Parameter [input]: | _filePos | Position of the char in the file. |
checkAvaillable
# bool checkAvaillable (char32_t _val,check if an element or attribute is availlable (not : !"#$%&'()+,/;<=>?@[\]^`{|}~ \n\t\r and for first char : not -.0123456789).
bool _firstChar) const;
Parameter [input]: | _val | Value to check the conformity. | Parameter [input]: | _firstChar | True if the element check is the first char. |
countWhiteChar
# int32_t countWhiteChar (const std::string & _data,count the number of white char in the string from the specify position (stop at the first element that is not a white char)
int32_t _pos,
exml::filePos & _filePos) const;
Parameter [input]: | _data | Data to parse. | Parameter [input]: | _pos | Start position in the string. | Parameter [output]: | _filePos | new poistion of te file to add. |
Return: | number of white element. |
toDocument
+ virtual exml::Document* toDocument (void );Cast the element in a Document if it is possible.
Return: | pointer on the class or NULL. |
toDocument
+ virtual const exml::Document* toDocument (void ) const;
toAttribute
+ virtual exml::Attribute* toAttribute (void );Cast the element in a Attribute if it is possible.
Return: | pointer on the class or NULL. |
toAttribute
+ virtual const exml::Attribute* toAttribute (void ) const;
toComment
+ virtual exml::Comment* toComment (void );Cast the element in a Comment if it is possible.
Return: | pointer on the class or NULL. |
toComment
+ virtual const exml::Comment* toComment (void ) const;
toDeclaration
+ virtual exml::Declaration* toDeclaration (void );Cast the element in a Declaration if it is possible.
Return: | pointer on the class or NULL. |
toDeclaration
+ virtual const exml::Declaration* toDeclaration (void ) const;
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;
toText
+ virtual exml::Text* toText (void );Cast the element in a Text if it is possible.
Return: | pointer on the class or NULL. |
toText
+ virtual const exml::Text* toText (void ) const;
isDocument
+ bool isDocument (void ) const;check if the node is a exml::Document
Return: | true if the node is a exml::Document |
isAttribute
+ bool isAttribute (void ) const;check if the node is a exml::Attribute
Return: | true if the node is a exml::Attribute |
isComment
+ bool isComment (void ) const;check if the node is a exml::Comment
Return: | true if the node is a exml::Comment |
isDeclaration
+ bool isDeclaration (void ) const;check if the node is a exml::Declaration
Return: | true if the node is a exml::Declaration |
isElement
+ bool isElement (void ) const;check if the node is a exml::Element
Return: | true if the node is a exml::Element |
isText
+ bool isText (void ) const;check if the node is a exml::Text
Return: | true if the node is a exml::Text |
clear
+ virtual void clear (void );clear the Node