Append the operand string to the contents of this.

Return TypeFunction nameArguments
hzString&hzString::operator+=(hzString&,)

Declared in file: hzString.h
Defined in file : hzString.cpp

Function Logic:

0:START 1:unknown 2:Return *this 3:suppCtl crlen 4:unknown 5:thisCtl crlen Length 6:nulen destAddr destCtl items tgt 7:unknown 8:items 9:items tgt destCtl 10:unknown 11:unknown 12:items 13:unknown 14:items 15:unknown 16:items 17:m_addr 18:Return *this

Function body:

hzString& hzString::operator+= (hzString& op)
{
   //  Append the operand string to the contents of this.
   //  
   //  Argument: op Operand string
   //  Returns: Reference to this string in all cases
   _hzfunc("hzString::op+=(hzString&)") ;
   _strItem*   thisCtl = 0;    //  This string control area
   _strItem*   suppCtl ;       //  Supplied string control area
   _strItem*   destCtl ;       //  Result string space
   char*       tgt ;           //  Target data area
   uint32_t    destAddr ;      //  New string address if required
   uint32_t    crlen ;         //  Len of this string
   uint32_t    nulen ;         //  Len of combined string
   //  If operand is empty do nothing
   if (!op.m_addr)
       return *this ;
   suppCtl = _strXlate(op.m_addr) ;
   crlen = 0;
   if (m_addr)
   {
       thisCtl = _strXlate(m_addr) ;
       crlen = thisCtl->_getSize() ;
   }
   //  Calculate required length
   nulen = Length() + op.Length() ;
   //  Allocate and populate a new buffer
   destAddr = _strAlloc(nulen) ;
   destCtl = _strXlate(destAddr) ;
   destCtl->_setSize(nulen) ;
   tgt = destCtl->_data() ;
   if (crlen)
       memcpy(tgt, thisCtl->_data(), crlen) ;
   memcpy(tgt + crlen, suppCtl->_data(), suppCtl->_getSize()) ;
   tgt[nulen] = 0;
   destCtl->m_copy = 1;
   //  Tidy up
   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
       {
           if (__sync_add_and_fetch(&(thisCtl->m_copy), -1)== 0)
               _strFree(m_addr, thisCtl->_getSize()) ;
       }
   }
   m_addr = destAddr ;
   return *this ;
}