| Return Type | Function name | Arguments |
|---|---|---|
| void | hdbClass::DescClass | (hzChain&,unsigned int,) |
Declared in file: hzDatabase.h
Defined in file : hdbClass.cpp
Function Logic:
Function body:
void hdbClass::DescClass (hzChain& Z, unsigned int nIndent)
{
_hzfunc("hdbClass::DescClass") ;
const hdbDatatype* pType ;
const hdbClass* pSubClass ;
const hdbMember* pMbr ;
uint32_t mbrNo ;
uint32_t n ;
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" ;
}