Initialize a HTML element (tag) to the parent element (if any), the tag type. Set also the id and line number (within the HTML in question)
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzHtmElem::Init | (hzDocHtml*,hzHtmElem*,hzString&,hzHtagtype,uint32_t,uint32_t,) |
Declared in file: hzDocument.h
Defined in file : hzDocHtml.cpp
Function Logic:
Function body:
hzEcode hzHtmElem::Init (hzDocHtml* pRoot)hzHtmElem* pParent, hzString& tagname, hzHtagtype type, uint32_t id, uint32_t line,
{
// Initialize a HTML element (tag) to the parent element (if any), the tag type. Set also the id and line number (within the HTML
// in question)
//
// Arguments: 1) pRoot Pointer to the HTML document root
// 2) pParent Pointer to the parent element of this
// 3) tagname The name of this tag
// 4) htag HTML Tag type
// 5) id Numeric identifier
// 6) line Line number of tag in the source HTML file
//
// Returns: E_ARGUMENT If no root is supplied
// E_OK If the HTML element was initialized
_hzfunc("hzHtmElem::Init") ;
if (!pRoot)
{
hzerr(E_ARGUMENT, "No root supplied") ;
return E_ARGUMENT ;
}
if (!pParent)
{
m_Parent = 0;
m_nLevel = 0;
}
else
{
m_Parent = pParent->GetUid() ;
m_nLevel = pParent->m_nLevel + 1;
pParent->_addnode(this) ;
}
m_Name = tagname ;
m_Type = type ;
m_Uid = id ;
m_nLine = line ;
m_Children = 0;
m_Sibling = 0;
return E_OK ;
}