Return TypeFunction nameArguments
hzString&hzString::Reverse(void)

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

Function Logic:

0:START 1:!m_addr 2:Return *this 3:_strXlate thisCtl _strItem::_getSize nLen _strAlloc destAddr _strXlate destCtl _strItem::_setSize destCtl c_down _strItem::_data pSrc _strItem::_data pTgt c_up 4:c_up 5:pTgt 6:thisCtl->m_copy&&thisCtl->m_copy<50 7:!_hzGlobal_MT 8:items 9:!thisCtl->m_copy 10:_strItem::_getSize _strFree 11:items 12:!thisCtl->m_copy 13:_strItem::_getSize _strFree 14:m_addr 15:Return *this

Function body:

hzString& hzString::Reverse (void)
{
   _hzfunc("hzString::Reverse") ;
   _strItem*   thisCtl ;
   _strItem*   destCtl ;
   char*       pTgt ;
   char*       pSrc ;
   uint32_t    destAddr ;
   uint32_t    nLen ;
   uint32_t    c_up ;
   uint32_t    c_down ;
   if (!m_addr)
       return *this ;
   thisCtl = (_strItem*) _strXlate(m_addr) ;
   nLen = thisCtl->_getSize() ;
   destAddr = _strAlloc(nLen) ;
   destCtl = (_strItem*) _strXlate(destAddr) ;
   destCtl->_setSize(nLen) ;
   destCtl->m_copy = 1;
   c_down = nLen - 1;
   pSrc = thisCtl->_data() ;
   pTgt = destCtl->_data() ;
   for (c_up = 0; c_up < c_down ; c_up++, c_down--)
   {
       pTgt[c_up] = pSrc[c_down] ;
   }
   if (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 ;
}