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

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

Function Logic:

0:START 1:!m_addr 2:Return *this 3:_strXlate thisCtl bChange _strItem::_data _strItem::_getSize 4:nLen; 5:*i>='a'&&*i<='z' 6:bChange 7:!bChange 8:Return *this 9:_strItem::_getSize nLen _strAlloc destAddr _strXlate destCtl _strItem::_setSize destCtl _strItem::_data i _strItem::_data j 10:nLen; 11:toupper * 12:thisCtl->m_copy&&thisCtl->m_copy<50 13:!_hzGlobal_MT 14:items 15:__sync_add_and_fetch 16:!thisCtl->m_copy 17:_strItem::_getSize _strFree 18:m_addr 19:Return *this

Function body:

hzString& hzString::ToUpper (void)
{
   _hzfunc("hzString::ToUpper") ;
   _strItem*   thisCtl ;
   _strItem*   destCtl ;
   char*       i ;
   char*       j ;
   uint32_t    nLen ;
   uint32_t    destAddr ;
   bool        bChange ;
   if (!m_addr)
       return *this ;
   thisCtl = (_strItem*) _strXlate(m_addr) ;
   bChange = false ;
   for (i = (char*) thisCtl->_data(), nLen = thisCtl->_getSize() ; nLen ; i++, nLen--)
   {
       if (*i >&eq; ''a''&&*i <&eq; ''z'')
           { bChange = true ; break ; }
   }
   if (!bChange)
       return *this ;
   nLen = thisCtl->_getSize() ;
   destAddr = _strAlloc(nLen) ;
   destCtl = (_strItem*) _strXlate(destAddr) ;
   destCtl->_setSize(nLen) ;
   destCtl->m_copy = 1;
   i = (char*) thisCtl->_data() ;
   j = (char*) destCtl->_data() ;
   for (; nLen ; nLen--)
       *j++ = toupper(*i++) ;
   if (thisCtl->m_copy && thisCtl->m_copy < 50)
   {
       if (!_hzGlobal_MT)
           thisCtl->m_copy-- ;
       else
           __sync_add_and_fetch(&(thisCtl->m_copy), -1);
       if (!thisCtl->m_copy)
           _strFree(m_addr, thisCtl->_getSize()) ;
   }
   m_addr = destAddr ;
   return *this ;
}