Return Type | Function name | Arguments |
---|---|---|
hzString& | hzString::operator+= | (const hzString&,) |
Declared in file: hzString.h
Defined in file : hzString.cpp
Function Logic:
Function body:
hzString& hzString::operator+= (const hzString& op) { _hzfunc("hzString::op+=(hzString&)") ; _strItem* thisCtl = 0; _strItem* suppCtl ; _strItem* destCtl ; uint32_t destAddr ; uint32_t crlen ; uint32_t nulen ; if (!op.m_addr) return *this ; suppCtl = (_strItem*) _strXlate(op.m_addr) ; crlen = 0; if (m_addr) { thisCtl = (_strItem*) _strXlate(m_addr) ; crlen = thisCtl->_getSize() ; } nulen = crlen + suppCtl->_getSize() ; destAddr = _strAlloc(nulen) ; destCtl = (_strItem*) _strXlate(destAddr) ; destCtl->_setSize(nulen) ; if (crlen) memcpy(destCtl->_data(), thisCtl->_data(), crlen) ; memcpy(destCtl->_data() + crlen, suppCtl->_data(), suppCtl->_getSize() + 1); destCtl->m_copy = 1; if (thisCtl && thisCtl->m_copy && thisCtl->m_copy < 50) { if (!_hzGlobal_MT) { thisCtl->m_copy-- ; if (!thisCtl->m_copy) _strFree(m_addr, thisCtl->_getSize()) ; } else { thisCtl->m_copy-- ; if (!thisCtl->m_copy) _strFree(m_addr, thisCtl->_getSize()) ; } } m_addr = destAddr ; return *this ; }