Return TypeFunction nameArguments
hzString&hzString::ToLower(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:count; 5:*i>='A'&&*i<='Z' 6:bChange 7:!bChange 8:Return *this 9:_strItem::_getSize count _strAlloc destAddr _strXlate destCtl _strItem::_setSize destCtl _strItem::_data i _strItem::_data j 10:count; 11:tolower * 12:thisCtl->m_copy&&thisCtl->m_copy<50 13:!_hzGlobal_MT 14:items 15:__sync_add_and_fetch(&(thisCtl->m_copy),-1)==0 16:!thisCtl->m_copy 17:_strItem::_getSize _strFree 18:m_addr 19:Return *this

Function body:

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