#include <Element.hpp>
Public Member Functions | |
size_t | size () const |
void | append (const ememory::SharedPtr< exml::internal::Node > &_node) |
void | remove (const std::string &_nodeName) |
enum nodeType | getType (int32_t _id) const |
ememory::SharedPtr< Node > | getNode (int32_t _id) |
const ememory::SharedPtr< Node > | getNode (int32_t _id) const |
ememory::SharedPtr< Element > | getElement (int32_t _id) |
const ememory::SharedPtr< Element > | getElement (int32_t _id) const |
ememory::SharedPtr< Element > | getNamed (const std::string &_name) |
const ememory::SharedPtr< Element > | getNamed (const std::string &_name) const |
std::string | getText () const |
enum nodeType | getType () const override |
bool | iParse (const std::string &_data, int32_t &_pos, bool _caseSensitive, exml::FilePos &_filePos, exml::internal::Document &_doc) override |
bool | iGenerate (std::string &_data, int32_t _indent) const override |
ememory::SharedPtr< exml::internal::Element > | toElement () override |
const ememory::SharedPtr< exml::internal::Element > | toElement () const override |
void | clear () override |
Public Member Functions inherited from exml::internal::AttributeList | |
size_t | sizeAttribute () const |
void | appendAttribute (const ememory::SharedPtr< exml::internal::Attribute > &_attr) |
ememory::SharedPtr< Attribute > | getAttr (int32_t _id) |
ememory::SharedPtr< const Attribute > | getAttr (int32_t _id) const |
std::pair< std::string, std::string > | getAttrPair (int32_t _id) const |
const std::string & | getAttribute (const std::string &_name) const |
bool | existAttribute (const std::string &_name) const |
void | setAttribute (const std::string &_name, const std::string &_value) |
bool | removeAttribute (const std::string &_name) |
Public Member Functions inherited from exml::internal::Node | |
virtual | ~Node ()=default |
const exml::FilePos & | getPos () const |
virtual void | setValue (std::string _value) |
virtual const std::string & | getValue () const |
virtual ememory::SharedPtr< exml::internal::Document > | toDocument () |
virtual const ememory::SharedPtr< exml::internal::Document > | toDocument () const |
virtual ememory::SharedPtr< exml::internal::Attribute > | toAttribute () |
virtual const ememory::SharedPtr< exml::internal::Attribute > | toAttribute () const |
virtual ememory::SharedPtr< exml::internal::Comment > | toComment () |
virtual const ememory::SharedPtr< exml::internal::Comment > | toComment () const |
virtual ememory::SharedPtr< exml::internal::Declaration > | toDeclaration () |
virtual const ememory::SharedPtr< exml::internal::Declaration > | toDeclaration () const |
virtual ememory::SharedPtr< exml::internal::Text > | toText () |
virtual const ememory::SharedPtr< exml::internal::Text > | toText () const |
bool | isDocument () const |
bool | isAttribute () const |
bool | isComment () const |
bool | isDeclaration () const |
bool | isElement () const |
bool | isText () const |
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 |
Static Public Member Functions | |
static ememory::SharedPtr< Element > | create (const std::string &_value="") |
Protected Member Functions | |
Element () | |
Element (const std::string &_value) | |
bool | subParse (const std::string &_data, int32_t &_pos, bool _caseSensitive, exml::FilePos &_filePos, exml::internal::Document &_doc, bool _mainNode=false) |
Protected Member Functions inherited from exml::internal::AttributeList | |
AttributeList (const std::string &_value="") | |
Protected Member Functions inherited from exml::internal::Node | |
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 | |
std::vector< ememory::SharedPtr< exml::internal::Node > > | m_listSub |
Protected Attributes inherited from exml::internal::AttributeList | |
std::vector< ememory::SharedPtr< exml::internal::Attribute > > | m_listAttribute |
Protected Attributes inherited from exml::internal::Node | |
exml::FilePos | m_pos |
std::string | m_value |
Detailed Description
Basic element Node of an XML document <YYYYY>.
Constructor & Destructor Documentation
§ Element() [1/2]
|
inlineprotected |
Constructor.
§ Element() [2/2]
|
inlineprotected |
Constructor.
- Parameters
-
[in] _value Element name;
Member Function Documentation
§ append()
void exml::internal::Element::append | ( | const ememory::SharedPtr< exml::internal::Node > & | _node | ) |
add a node at the element (not exml::internal::Attribute (move in the attribute automaticly).
- Parameters
-
[in] _node Pointer of the node to add.
§ clear()
|
overridevirtual |
clear the Node
Reimplemented from exml::internal::AttributeList.
§ create()
|
static |
factory of an exml::internal::Element
- Parameters
-
[in] _value Name of the node.
- Returns
- Shared pointer on the Element
§ getElement() [1/2]
ememory::SharedPtr<Element> exml::internal::Element::getElement | ( | int32_t | _id | ) |
get the element casted in Element (if the node is not an element return NULL).
- Parameters
-
[in] _id Id of the element.
- Returns
- Pointer on the element or NULL.
§ getElement() [2/2]
const ememory::SharedPtr<Element> exml::internal::Element::getElement | ( | int32_t | _id | ) | const |
get the element casted in Element (if the node is not an element return NULL).
- Parameters
-
[in] _id Id of the element.
- Returns
- Pointer on the element or NULL.
§ getNamed() [1/2]
ememory::SharedPtr<Element> exml::internal::Element::getNamed | ( | const std::string & | _name | ) |
get an element with his name (work only with exml::internal::Element)
- Parameters
-
[in] _name Name of the element that is requested
- Returns
- Pointer on the element or NULL.
§ getNamed() [2/2]
const ememory::SharedPtr<Element> exml::internal::Element::getNamed | ( | const std::string & | _name | ) | const |
get an element with his name (work only with exml::internal::Element)
- Parameters
-
[in] _name Name of the element that is requested
- Returns
- Pointer on the element or NULL.
§ getNode() [1/2]
ememory::SharedPtr<Node> exml::internal::Element::getNode | ( | int32_t | _id | ) |
get the Node pointer of the element id.
- Parameters
-
[in] _id Id of the element.
- Returns
- Pointer on node.
§ getNode() [2/2]
const ememory::SharedPtr<Node> exml::internal::Element::getNode | ( | int32_t | _id | ) | const |
get the Node pointer of the element id.
- Parameters
-
[in] _id Id of the element.
- Returns
- Pointer on node.
§ getText()
std::string exml::internal::Element::getText | ( | ) | const |
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[...]]>
- Returns
- the curent data string. if Only one text node, then we get the parssed data (no & ...) if more than one node, then we transform &,",',<,> in xml normal text...
§ getType() [1/2]
enum nodeType exml::internal::Element::getType | ( | int32_t | _id | ) | const |
get the type of the element id.
- Parameters
-
[in] _id Id of the element.
- Returns
- the Current type of the element or exml::internal::typeUnknow.
§ getType() [2/2]
|
inlineoverridevirtual |
§ iGenerate()
|
overridevirtual |
generate a string with the tree of the xml
- Parameters
-
[in,out] _data string where to add the elements [in] _indent current indentation of the file
- Returns
- false if an error occured.
Reimplemented from exml::internal::AttributeList.
§ iParse()
|
overridevirtual |
parse the Current node [pure VIRUAL]
- Parameters
-
[in] _data data string to parse. [in,out] _pos position in the string to start parse, return the position end of parsing. [in] _caseSensitive Request a parsion of element that is not case sensitive (all element is in low case) [in,out] _filePos file parsing position (line x col x) [in,out] _doc Base document reference
- Returns
- false if an error occured.
Implements exml::internal::Node.
§ remove()
void exml::internal::Element::remove | ( | const std::string & | _nodeName | ) |
Remove all element with this name.
- Parameters
-
[in] _nodeName Name of nodes to remove.
§ size()
|
inline |
get the number of sub element in the node (can be exml::internal::Comment ; exml::internal::Element ; exml::internal::Text :exml::internal::Declaration).
- Returns
- a number >=0.
§ subParse()
|
protected |
Parse sub node string.
- Parameters
-
[in] _data all file string data [in,out] _pos Position to start parsing in the file and return the end of parsing [in] _caseSensitive Case sensitive parsing (usefull for html) [in] _filePos Current File position of the parsing [in] _doc Document base reference [in] _mainNode if true, this is the first root node
- Returns
- true parsing is done OK
- false An error appear in the parsing
§ toElement() [1/2]
|
overridevirtual |
Cast the element in a Element if it is possible.
- Returns
- pointer on the class or nullptr.
Reimplemented from exml::internal::Node.
§ toElement() [2/2]
|
overridevirtual |
Cast the element in a Element if it is possible.
- Returns
- CONST pointer on the class or nullptr.
Reimplemented from exml::internal::Node.
Member Data Documentation
§ m_listSub
|
protected |
List of subNodes.
The documentation for this class was generated from the following file:
- framework/atria-soft/exml/exml/internal/Element.hpp