Initialize a hzXmlNode, insert it into the host document's array of nodes and return the in-situ pointer Pointer to node in-situ
| Return Type | Function name | Arguments |
|---|---|---|
| hzXmlNode* | hzXmlNode::Init | (hzDocXml*,hzXmlNode*,hzString&,uint32_t,uint32_t,bool,) |
Declared in file: hzDocument.h
Defined in file : hzDocXml.cpp
Function Logic:
Function body:
hzXmlNode* hzXmlNode::Init (hzDocXml* pHostDoc)hzXmlNode* pParent, hzString& name, uint32_t nLineNo, uint32_t nCol, bool bXmlesce,
{
// Initialize a hzXmlNode, insert it into the host document's array of nodes and return the in-situ pointer
//
// Arguments: 1) pHostDoc The host document
// 2) pParent The parent node (to this)
// 3) snName The string number for the node name
// 4) nLineNo The config file line number
// 5) nCol The config file column position
// 6) bXmlesce Flag for XML-esce rules
//
// Returns: Pointer to node in-situ
_hzfunc("hzXmlNode::Init") ;
hzXmlNode* pInSitu ; // Final address in host document array of nodes
if (!pHostDoc)
hzexit(E_ARGUMENT, "No host document supplied") ;
m_pHostDoc = pHostDoc ;
if (!pParent)
{
m_Parent = 0;
m_nLevel = 0;
}
else
{
m_Parent = pParent->m_Uid ;
m_nLevel = pParent->m_nLevel + 1;
}
m_bXmlesce = bXmlesce ? 1: 0;
// m_snName = snName ;
m_Name = name ;
m_nLine = m_nAnti = nLineNo ;
m_nCol = nCol ;
m_Uid = pHostDoc->m_arrNodes.Count() + 1;
pHostDoc->m_arrNodes.Add(*this) ;
pInSitu = pHostDoc->m_arrNodes.InSitu(m_Uid-1);
return pInSitu ;
}