ADTF
|
representation for an element of the cDom More...
Public Member Functions | |
A_UTILS_DEPRECATED() | cDOMElement () |
Default constructor. More... | |
A_UTILS_DEPRECATED() | cDOMElement (const cDOMElement &oElement) |
Copy constructor. More... | |
virtual | ~cDOMElement () |
Destructor. | |
cDOMElement & | operator= (const cDOMElement &oElement) |
Copy assignment operator. More... | |
tResult | Free () |
Frees all allocated resources. More... | |
const cString & | GetName () const |
Returns the name of the element. More... | |
tVoid | SetName (const cString &strName) |
Sets the name of the element. More... | |
cDOMElement & | GetParent () |
Returns the elements parent element. More... | |
const cDOMElement & | GetParent () const |
Returns the elements parent element. More... | |
cDOM & | GetDocument () |
Returns the document that the element belongs to. More... | |
const cDOM & | GetDocument () const |
Returns the document that the element belongs to. More... | |
cDOMElementList & | GetChildren () |
Returns a list of all child elements of the element. More... | |
const cDOMElementList & | GetChildren () const |
Returns a list of all child elements of the element. More... | |
const cString & | GetData () const |
Returns the data of the element. More... | |
tVoid | SetData (const cString &strData) |
Sets the data of the element. More... | |
cDOMAttributes & | GetAttributes () |
Returns a map of alle attributes of the element. More... | |
const cDOMAttributes & | GetAttributes () const |
Returns a map of alle attributes of the element. More... | |
tBool | Exists (const cString &strName) const |
Checks if an attribute exists. More... | |
cString | GetAttribute (const cString &strName, const cString &strDefault=cString()) const |
Returns the value of an attribute. More... | |
tInt | GetAttributeInt (const cString &strName, tInt nDefault=0) const |
Returns the value of an attribute interpreted as an integer. More... | |
tUInt32 | GetAttributeUInt32 (const cString &strName, tUInt32 nDefault=0) const |
Returns the value of an attribute interpreted as an integer. More... | |
tBool | GetAttributeBool (const cString &strName, tBool bDefault=tFalse) const |
Returns the value of an attribute interpreted as a boolean. More... | |
tFloat64 | GetAttributeFloat64 (const cString &strName, tFloat64 fDefault=0.0) const |
Returns the value of an attribute interpreted as a float. More... | |
tVoid | SetAttribute (const cString &strName, const cString &strValue) |
Sets an attribute. More... | |
tVoid | EraseAttribute (const cString &strName) |
Removes an attribute. More... | |
const cString & | GetPath () const |
returns the current path More... | |
tResult | FindNode (const tChar *strQuery, cDOMElement *&poElement) |
Finds a node based on a query. More... | |
tResult | FindNodes (const tChar *strQuery, cDOMElementRefList &lstElements, tInt32 ui32Flags=0) |
Finds nodes based on a query. More... | |
tResult | FromString (const tChar *strXML) |
Creates the element from an xml string. More... | |
cString | ToString () const |
Creates an xml representation of the element. More... | |
tResult | CreateChild (const cString &strName, cDOMElement *&poChild) |
Creates a new child element. More... | |
tResult | InsertChild (const cDOMElement &oChild) |
Adds an existing child element. More... | |
tResult | InsertBefore (const cDOMElement &oChild, cDOMElement *pBefore) |
Inserts an existing child element at a specified position. More... | |
cDOMElement * | GetChild (const cString &strName) |
Find the first child of that name of this element. More... | |
const cDOMElement * | GetChild (const cString &strName) const |
Find the first child of that name of this element. More... | |
tResult | Delete () |
Removes the element from its parent element. More... | |
Protected Member Functions | |
tResult | Create (const tChar *&ptr, cDOMElement *pParent, cDOM *pDocument, const tChar *pStart=nullptr) |
Parses the DOM element from the input string. More... | |
tVoid | CreateChild (const std::list< cString > &lstComment, const tInt &nFlag=0) |
Parses comments from and creates pseudo DOM childs. More... | |
tResult | ReadAttributes (const tChar *&ptr, const tChar *pStart=nullptr) |
Parses the attributes from the input string. More... | |
tResult | ReadData (const tChar *&ptr, const tChar *pStart=nullptr) |
Parses the data from the input string. More... | |
tBool | MatchQuery (const tChar *ptr, tUInt32 &o_nOffset) |
Matches the query with the child attributes. More... | |
tBool | MatchAttributes (const tChar *pString) |
Matches the attributes of the DOM child. More... | |
tResult | FindNodesImpl (const tChar *strQuery, cDOMElementRefList &lstElements, tBool &bFinished, tUInt32 ui32Flags) |
Find nodes who matches the query string. More... | |
cString | ToStringImpl (tUInt32 ui32Flags, tInt nIndentLevel=0) const |
Converts the DOM element into a textual XML like representation. More... | |
Protected Attributes | |
cDOM * | m_pDocument |
the complete xml document | |
cDOMElement * | m_pParent |
the parent element | |
cDOMElementList | m_lstChildren |
list of all children | |
cString | m_strName |
the name of the element | |
cString | m_strPath |
the path to the element | |
cString | m_strData |
raw data of the element | |
cDOMAttributes | m_mapAttributes |
maps several attributs of the element | |
Static Protected Attributes | |
static cString | m_strEmptyValue |
empty string | |
static cDOMElement | m_oNullElement |
empty element | |
Private Member Functions | |
tResult | MergeIncludeNode (cDOMElement &oIncludeNode) |
tVoid | Copy (const cDOMElement &oFromElement, cDOMElement *pParent, cDOM *pDocument, const cString &strPath) |
representation for an element of the cDom
Definition at line 54 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/std/dom.h.
Default constructor.
A_UTILS_DEPRECATED() cDOMElement | ( | const cDOMElement & | oElement | ) |
Copy constructor.
oElement | [in] The object to copy. |
|
protected |
Parses the DOM element from the input string.
ptr | [in/out] Pointer to parser input |
pParent | [in] The parent element |
pDocument | [in] The DOM document |
pStart | [in] Pointer to the start of the document input string |
tResult CreateChild | ( | const cString & | strName, |
cDOMElement *& | poChild | ||
) |
Creates a new child element.
strName | [in] The name of the child. |
poChild | [out] |
Parses comments from and creates pseudo DOM childs.
lstComment | [in] List of comment strings |
nFlag | [in] 1: before DOM child. 2: after DOM child |
tResult Delete | ( | ) |
Removes the element from its parent element.
Removes an attribute.
strName | [in] The name of the attribute. |
Checks if an attribute exists.
strName | [in] The name of the attribute. |
tResult FindNode | ( | const tChar * | strQuery, |
cDOMElement *& | poElement | ||
) |
Finds a node based on a query.
Some basic syntax:
Here are some examples of search queries.
strQuery | [in] The query string. |
poElement | [out] This will point to the found element. |
ERR_NOT_FOUND | No matching node found. |
tResult FindNodes | ( | const tChar * | strQuery, |
cDOMElementRefList & | lstElements, | ||
tInt32 | ui32Flags = 0 |
||
) |
Finds nodes based on a query.
See FindNode for the syntax.
strQuery | [in] The query string. |
lstElements | [out] This list will be filled with the found elements. |
ui32Flags | [in] Internal use |
ERR_NOT_FOUND | No matching node found. |
|
protected |
Find nodes who matches the query string.
strQuery | [in] The query string. |
lstElements | [out] List of DOM elements who matches the query |
bFinished | [out] True if find operation was successful, false otherwise |
ui32Flags | [in] Internal use |
tResult Free | ( | ) |
Frees all allocated resources.
Creates the element from an xml string.
strXML | [in] The xml string. |
Returns the value of an attribute.
strName | [in] The name of the attribute. |
strDefault | [in] A default value that is returned if the attribute does not exist. |
Returns the value of an attribute interpreted as a boolean.
strName | [in] The name of the attribute. |
bDefault | [in] A default value that is returned if the attribute does not exist. |
Returns the value of an attribute interpreted as a float.
strName | [in] The name of the attribute. |
fDefault | [in] A default value that is returned if the attribute does not exist. |
Returns the value of an attribute interpreted as an integer.
strName | [in] The name of the attribute. |
nDefault | [in] A default value that is returned if the attribute does not exist. |
cDOMAttributes& GetAttributes | ( | ) |
Returns a map of alle attributes of the element.
const cDOMAttributes& GetAttributes | ( | ) | const |
Returns a map of alle attributes of the element.
Returns the value of an attribute interpreted as an integer.
strName | [in] The name of the attribute. |
nDefault | [in] A default value that is returned if the attribute does not exist. |
cDOMElement* GetChild | ( | const cString & | strName | ) |
Find the first child of that name of this element.
strName | [in] The name of the child element. |
const cDOMElement* GetChild | ( | const cString & | strName | ) | const |
Find the first child of that name of this element.
strName | [in] The name of the child element. |
cDOMElementList& GetChildren | ( | ) |
Returns a list of all child elements of the element.
const cDOMElementList& GetChildren | ( | ) | const |
Returns a list of all child elements of the element.
const cString& GetData | ( | ) | const |
Returns the data of the element.
cDOM& GetDocument | ( | ) |
Returns the document that the element belongs to.
const cDOM& GetDocument | ( | ) | const |
Returns the document that the element belongs to.
const cString& GetName | ( | ) | const |
Returns the name of the element.
cDOMElement& GetParent | ( | ) |
Returns the elements parent element.
const cDOMElement& GetParent | ( | ) | const |
Returns the elements parent element.
const cString& GetPath | ( | ) | const |
returns the current path
path |
tResult InsertBefore | ( | const cDOMElement & | oChild, |
cDOMElement * | pBefore | ||
) |
Inserts an existing child element at a specified position.
oChild | [in] The child element. |
pBefore | [in] The child element that the new child element should be inserted before. |
tResult InsertChild | ( | const cDOMElement & | oChild | ) |
Adds an existing child element.
oChild | [in] The child element. |
Matches the attributes of the DOM child.
pString | [in] Attributes to match |
Matches the query with the child attributes.
ptr | [in] Pointer to parser input |
o_nOffset | [out] Offset in input string where matching stopped |
cDOMElement& operator= | ( | const cDOMElement & | oElement | ) |
Copy assignment operator.
oElement | [in] The element to copy to. |
Parses the attributes from the input string.
ptr | [in/out] Pointer to parser input |
pStart | [in] Pointer to the start of the document input string |
Parses the data from the input string.
ptr | [in/out] Pointer to parser input |
pStart | [in] Pointer to the start of the document input string |
Sets an attribute.
strName | [in] The attribute name. |
strValue | [in] The value of the attribute. |
Sets the data of the element.
strData | [in] The new data. |
Sets the name of the element.
strName | [in] The new name. |
cString ToString | ( | ) | const |
Creates an xml representation of the element.