Purpose: Set this string equal to the operand. If the internal address of this string instance is already equal to that of the operand, this function does nothing. Otherwise this string is cleared, the copy count of the operand string is incremented, then the internal address is set to that of the operand.

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

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

Function Logic:

0:START 1:unknown 2:items 3:unknown 4:Return *this 5:unknown 6:items 7:unknown 8:suppCtl 9:unknown 10:unknown 11:items 12:items 13:m_addr 14:Return *this

Function body:

hzString& hzString::operator= (hzString& op)
{
   //  Purpose: Set this string equal to the operand.
   //  
   //  If the internal address of this string instance is already equal to that of the operand, this function does nothing. Otherwise this string is cleared, the copy count of the
   //  operand string is incremented, then the internal address is set to that of the operand.
   //  
   //  Argument: op  Reference to the operand hzString instance.
   //  
   //  Returns: Reference to this string instance
   _hzfunc("hzString::operator=(hzString&)") ;
   _strItem*   suppCtl ;       //  Supplied string's control area
   if (!this)
       hzerr(E_CORRUPT, "No instance") ;
   //  It the this string's internal pointer and that of the operand already point to the same internal structure in memory, do nothing
   if (m_addr == op.m_addr)
       return *this ;
   //  If this string has a value, clear it.
   if (m_addr)
       Clear() ;
   //  If the operand has content, increment the copy count and make this string address equal to that of the supplied.
   if (op.m_addr)
   {
       suppCtl = _strXlate(op.m_addr) ;
       if (suppCtl->m_copy < 50)
       {
           if (_hzGlobal_MT)
               //  __sync_add_and_fetch((uint32_t*)&(suppCtl->m_copy), 1) ;
               suppCtl->m_copy++ ;
           else
               suppCtl->m_copy++ ;
       }
       m_addr = op.m_addr ;
   }
   return *this ;
}