#include <Node.hpp>

Inheritance diagram for exml::internal::Node:
ememory::EnableSharedFromThis< Node > ememory::EnableSharedFromThisBase exml::internal::Attribute exml::internal::AttributeList exml::internal::Comment exml::internal::Text exml::internal::Declaration exml::internal::Element exml::internal::TextCDATA exml::internal::DeclarationXML exml::internal::Document

Public Member Functions

virtual ~Node ()=default
 
virtual bool iParse (const std::string &_data, int32_t &_pos, bool _caseSensitive, exml::FilePos &_filePos, exml::internal::Document &_doc)=0
 
virtual bool iGenerate (std::string &_data, int32_t _indent) const
 
const exml::FilePosgetPos () const
 
virtual void setValue (std::string _value)
 
virtual const std::string & getValue () const
 
virtual enum nodeType getType () const
 
virtual ememory::SharedPtr< exml::internal::DocumenttoDocument ()
 
virtual const ememory::SharedPtr< exml::internal::DocumenttoDocument () const
 
virtual ememory::SharedPtr< exml::internal::AttributetoAttribute ()
 
virtual const ememory::SharedPtr< exml::internal::AttributetoAttribute () const
 
virtual ememory::SharedPtr< exml::internal::CommenttoComment ()
 
virtual const ememory::SharedPtr< exml::internal::CommenttoComment () const
 
virtual ememory::SharedPtr< exml::internal::DeclarationtoDeclaration ()
 
virtual const ememory::SharedPtr< exml::internal::DeclarationtoDeclaration () const
 
virtual ememory::SharedPtr< exml::internal::ElementtoElement ()
 
virtual const ememory::SharedPtr< exml::internal::ElementtoElement () const
 
virtual ememory::SharedPtr< exml::internal::TexttoText ()
 
virtual const ememory::SharedPtr< exml::internal::TexttoText () const
 
bool isDocument () const
 
bool isAttribute () const
 
bool isComment () const
 
bool isDeclaration () const
 
bool isElement () const
 
bool isText () const
 
virtual void clear ()
 
- Public Member Functions inherited from ememory::EnableSharedFromThis< Node >
ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis ()
 
const ememory::SharedPtr< EMEMORY_TYPE > sharedFromThis () const
 
ememory::WeakPtr< EMEMORY_TYPE > weakFromThis ()
 
const ememory::WeakPtr< EMEMORY_TYPE > weakFromThis () const
 

Protected Member Functions

 Node ()
 
 Node (const std::string &_value)
 
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
 

Protected Attributes

exml::FilePos m_pos
 
std::string m_value
 

Detailed Description

Basic main object of all xml elements.

Constructor & Destructor Documentation

§ Node() [1/2]

exml::internal::Node::Node ( )
inlineprotected

basic element of a xml structure

§ Node() [2/2]

exml::internal::Node::Node ( const std::string &  _value)
protected

basic element of a xml structure

Parameters
[in]_valuevalue of the node

§ ~Node()

virtual exml::internal::Node::~Node ( )
virtualdefault

Virtualize destructor.

Member Function Documentation

§ addIndent()

void exml::internal::Node::addIndent ( std::string &  _data,
int32_t  _indent 
) const
protected

add indentation of the string input.

Parameters
[in,out]_dataString where the indentation is done.
[in]_indentNumber of tab to add at the string.

§ checkAvaillable()

bool exml::internal::Node::checkAvaillable ( char32_t  _val,
bool  _firstChar 
) const
protected

check if an element or attribute is availlable (not : !"#$%&'()*+,/;<=>?@[]^`{|}~ \n\t\r and for first char : not -.0123456789).

Parameters
[in]_valValue to check the conformity.
[in]_firstCharTrue if the element check is the first char.
Returns
true The value can be a part of attribute name
false The value can NOT be a part of attribute name

§ clear()

virtual void exml::internal::Node::clear ( )
virtual

§ countWhiteChar()

int32_t exml::internal::Node::countWhiteChar ( const std::string &  _data,
int32_t  _pos,
exml::FilePos _filePos 
) const
protected

count the number of white char in the string from the specify position (stop at the first element that is not a white char)

Parameters
[in]_dataData to parse.
[in]_posStart position in the string.
[out]_filePosnew poistion of te file to add.
Returns
number of white element.

§ drawElementParsed()

void exml::internal::Node::drawElementParsed ( char32_t  _val,
const exml::FilePos _filePos 
) const
protected

Display the cuurent element that is curently parse.

Parameters
[in]_valChar that is parsed.
[in]_filePosPosition of the char in the file.

§ getPos()

const exml::FilePos& exml::internal::Node::getPos ( ) const

get the current position where the element is in the file

Returns
The file position reference

§ getType()

virtual enum nodeType exml::internal::Node::getType ( ) const
virtual

§ getValue()

virtual const std::string& exml::internal::Node::getValue ( ) const
virtual

get the current element Value.

Returns
the reference of the string value.

§ iGenerate()

virtual bool exml::internal::Node::iGenerate ( std::string &  _data,
int32_t  _indent 
) const
virtual

generate a string with the tree of the xml

Parameters
[in,out]_datastring where to add the elements
[in]_indentcurrent indentation of the file
Returns
false if an error occured.

Reimplemented in exml::internal::Element, exml::internal::Document, exml::internal::AttributeList, exml::internal::TextCDATA, exml::internal::Attribute, exml::internal::Text, exml::internal::Comment, and exml::internal::Declaration.

§ iParse()

virtual bool exml::internal::Node::iParse ( const std::string &  _data,
int32_t &  _pos,
bool  _caseSensitive,
exml::FilePos _filePos,
exml::internal::Document _doc 
)
pure virtual

parse the Current node [pure VIRUAL]

Parameters
[in]_datadata string to parse.
[in,out]_posposition in the string to start parse, return the position end of parsing.
[in]_caseSensitiveRequest a parsion of element that is not case sensitive (all element is in low case)
[in,out]_filePosfile parsing position (line x col x)
[in,out]_docBase document reference
Returns
false if an error occured.

Implemented in exml::internal::Element, exml::internal::TextCDATA, exml::internal::Attribute, exml::internal::Text, exml::internal::Declaration, and exml::internal::Comment.

§ isAttribute()

bool exml::internal::Node::isAttribute ( ) const

check if the node is a exml::internal::Attribute

Returns
true if the node is a exml::internal::Attribute

§ isComment()

bool exml::internal::Node::isComment ( ) const

check if the node is a exml::internal::Comment

Returns
true if the node is a exml::internal::Comment

§ isDeclaration()

bool exml::internal::Node::isDeclaration ( ) const

check if the node is a exml::internal::Declaration

Returns
true if the node is a exml::internal::Declaration

§ isDocument()

bool exml::internal::Node::isDocument ( ) const

check if the node is a exml::internal::Document

Returns
true if the node is a exml::internal::Document

§ isElement()

bool exml::internal::Node::isElement ( ) const

check if the node is a exml::internal::Element

Returns
true if the node is a exml::internal::Element

§ isText()

bool exml::internal::Node::isText ( ) const

check if the node is a exml::internal::Text

Returns
true if the node is a exml::internal::Text

§ setValue()

virtual void exml::internal::Node::setValue ( std::string  _value)
virtual

set the value of the node.

Parameters
[in]_valueNew value of the node.

§ toAttribute() [1/2]

virtual ememory::SharedPtr<exml::internal::Attribute> exml::internal::Node::toAttribute ( )
virtual

Cast the element in a Attribute if it is possible.

Returns
pointer on the class or nullptr.

Reimplemented in exml::internal::Attribute.

§ toAttribute() [2/2]

virtual const ememory::SharedPtr<exml::internal::Attribute> exml::internal::Node::toAttribute ( ) const
virtual

Cast the element in a Attribute if it is possible.

Returns
CONST pointer on the class or nullptr.

Reimplemented in exml::internal::Attribute.

§ toComment() [1/2]

virtual ememory::SharedPtr<exml::internal::Comment> exml::internal::Node::toComment ( )
virtual

Cast the element in a Comment if it is possible.

Returns
pointer on the class or nullptr.

Reimplemented in exml::internal::Comment.

§ toComment() [2/2]

virtual const ememory::SharedPtr<exml::internal::Comment> exml::internal::Node::toComment ( ) const
virtual

Cast the element in a Comment if it is possible.

Returns
CONST pointer on the class or nullptr.

Reimplemented in exml::internal::Comment.

§ toDeclaration() [1/2]

virtual ememory::SharedPtr<exml::internal::Declaration> exml::internal::Node::toDeclaration ( )
virtual

Cast the element in a Declaration if it is possible.

Returns
pointer on the class or nullptr.

Reimplemented in exml::internal::Declaration.

§ toDeclaration() [2/2]

virtual const ememory::SharedPtr<exml::internal::Declaration> exml::internal::Node::toDeclaration ( ) const
virtual

Cast the element in a Declaration if it is possible.

Returns
CONST pointer on the class or nullptr.

Reimplemented in exml::internal::Declaration.

§ toDocument() [1/2]

virtual ememory::SharedPtr<exml::internal::Document> exml::internal::Node::toDocument ( )
virtual

Cast the element in a Document if it is possible.

Returns
pointer on the class or nullptr.

Reimplemented in exml::internal::Document.

§ toDocument() [2/2]

virtual const ememory::SharedPtr<exml::internal::Document> exml::internal::Node::toDocument ( ) const
virtual

Cast the element in a Document if it is possible.

Returns
CONST pointer on the class or nullptr.

Reimplemented in exml::internal::Document.

§ toElement() [1/2]

virtual ememory::SharedPtr<exml::internal::Element> exml::internal::Node::toElement ( )
virtual

Cast the element in a Element if it is possible.

Returns
pointer on the class or nullptr.

Reimplemented in exml::internal::Element.

§ toElement() [2/2]

virtual const ememory::SharedPtr<exml::internal::Element> exml::internal::Node::toElement ( ) const
virtual

Cast the element in a Element if it is possible.

Returns
CONST pointer on the class or nullptr.

Reimplemented in exml::internal::Element.

§ toText() [1/2]

virtual ememory::SharedPtr<exml::internal::Text> exml::internal::Node::toText ( )
virtual

Cast the element in a Text if it is possible.

Returns
pointer on the class or nullptr.

Reimplemented in exml::internal::Text.

§ toText() [2/2]

virtual const ememory::SharedPtr<exml::internal::Text> exml::internal::Node::toText ( ) const
virtual

Cast the element in a Text if it is possible.

Returns
CONST pointer on the class or nullptr.

Reimplemented in exml::internal::Text.

Member Data Documentation

§ m_pos

exml::FilePos exml::internal::Node::m_pos
protected

position in the readed file == > not correct when the file is generated

§ m_value

std::string exml::internal::Node::m_value
protected

value of the node (for element this is the name, for text it is the inside text ...)


The documentation for this class was generated from the following file:
  • framework/atria-soft/exml/exml/internal/Node.hpp