Export Class Description Export XML fragment describing the data class to the supplied chain. Note that as the class description is expected to be part of an ADP, the supplied chain is not cleared by this function. Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | hdbClass::DescClass | (hzChain&,uint32_t,) |
Declared in file: hzDatabase.h
Defined in file : hdbClass.cpp
Function Logic:
Function body:
void hdbClass::DescClass (hzChain& Z)uint32_t nIndent,
{
// Export Class Description
//
// Export XML fragment describing the data class to the supplied chain. Note that as the class description is expected to be part of an ADP, the supplied chain is not cleared
// by this function.
//
// Arguments: 1) Z The chain to aggregate the class description to
// 2) nIndent The number of leading tabs to apply to each line
//
// Returns: None
_hzfunc("hdbClass::DescClass") ;
const hdbDatatype* pType ; // Member data type
const hdbClass* pSubClass ; // Sub-class where member is BASETYPE_CLASS
const hdbMember* pMbr ; // Member pointer
uint32_t mbrNo ; // Member iterator
uint32_t n ; // Indent counter
for (n = nIndent ; n > 0; n--)
Z.AddByte(CHAR_TAB) ;
switch (m_eDesignation)
{
case HDB_CLASS_DESIG_SYS: Z.Printf("<class id=\"%d\" desig=\"sys\" name=\"%s\">\n", m_ClassUID, txtType()) ; break ;
case HDB_CLASS_DESIG_USR: Z.Printf("<class id=\"%d\" desig=\"usr\" name=\"%s\">\n", m_ClassUID, txtType()) ; break ;
case HDB_CLASS_DESIG_CFG: Z.Printf("<class id=\"%d\" desig=\"cfg\" name=\"%s\">\n", m_ClassUID, txtType()) ; break ;
}
for (mbrNo = 0; mbrNo < MbrCount() ; mbrNo++)
{
pMbr = GetMember(mbrNo) ;
for (n = nIndent ; n > 0; n--)
Z.AddByte(CHAR_TAB) ;
pType = pMbr->Datatype() ;
if (!pType)
{
Z.Printf("\t<member posn=\"%d\" uid=\"%d\" popCtl=\"%s\" datatype=\"INVALID_DATA_TYPE\" name=\"%s\"/>\n",
pMbr->Posn(), pMbr->DeltaId(), PopCtl2Txt(pMbr->PopCtl()), pMbr->txtName()) ;
continue ;
}
if (!pMbr->IsClass())
{
Z.Printf("\t<member posn=\"%d\" uid=\"%d\" popCtl=\"%s\" datatype=\"%s\" name=\"%s\"/>\n",
pMbr->Posn(), pMbr->DeltaId(), PopCtl2Txt(pMbr->PopCtl()), pType->txtType(), pMbr->txtName()) ;
continue ;
}
if (pMbr->Basetype() == BASETYPE_CLASS)
{
Z.Printf("\t<member posn=\"%d\" uid=\"%d\" popCtl=\"%s\" subclass=\"%s\" name=\"%s\">\n",
pMbr->Posn(), pMbr->DeltaId(), PopCtl2Txt(pMbr->PopCtl()), pType->txtType(), pMbr->txtName()) ;
pSubClass = (hdbClass*) pMbr->Datatype() ;
pSubClass->DescClass(Z, nIndent + 1);
for (n = nIndent ; n > 0; n--)
Z.AddByte(CHAR_TAB) ;
Z << "\t</member>\n" ;
continue ;
}
}
for (n = nIndent ; n > 0; n--)
Z.AddByte(CHAR_TAB) ;
Z << "</class>\n" ;
}