Return TypeFunction nameArguments
hzString&hzString::UrlDecode(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::_data 4:*i; 5:*i==(char)37&&IsHex(i[1])&&IsHex(i[2]) 6:i 7:items 8:newLen==thisCtl->_getSize() 9:Return *this 10:_strAlloc destAddr _strXlate destCtl _strItem::_setSize destCtl _strItem::_data _strItem::_data 11:*i; 12:*i==(char)37 13:IsHex(i[1])&&IsHex(i[2]) 14:items val val items val * 15:* 16:thisCtl->m_copy&&thisCtl->m_copy<50 17:!_hzGlobal_MT 18:items 19:!thisCtl->m_copy 20:_strItem::_getSize _strFree 21:items 22:!thisCtl->m_copy 23:_strItem::_getSize _strFree 24:m_addr 25:Return *this

Function body:

hzString& hzString::UrlDecode (void)
{
   _hzfunc("hzString::UrlDecode") ;
   _strItem*   thisCtl ;
   _strItem*   destCtl ;
   char*       i ;
   char*       j ;
   uint32_t    destAddr ;
   uint32_t    newLen = 0;
   uint32_t    val ;
   if (!m_addr)
       return *this ;
   thisCtl = (_strItem*) _strXlate(m_addr) ;
   for (i = thisCtl->_data() ; *i ; i++)
   {
       if (*i == CHAR_PERCENT && IsHex(i[1])&& IsHex(i[2]))
           i += 2;
       newLen++ ;
   }
   if (newLen == thisCtl->_getSize())
       return *this ;
   destAddr = _strAlloc(newLen) ;
   destCtl = (_strItem*) _strXlate(destAddr) ;
   destCtl->_setSize(newLen) ;
   destCtl->m_copy = 1;
   for (j = destCtl->_data(), i = thisCtl->_data() ; *i ; i++)
   {
       if (*i == CHAR_PERCENT)
       {
           if (IsHex(i[1])&& IsHex(i[2]))
           {
               i++ ;
               val = (*i >&eq;''0''&&*i <&eq;''9''?*i-''0'':*i >&eq; ''A''&&*i<&eq; ''F''?*i+10-''A'':*i>&eq;''a''&&*i<&eq;''f''?*i+10-''a'':0);
               val *= 16;
               i++ ;
               val += (*i >&eq;''0''&&*i <&eq;''9''?*i-''0'':*i >&eq; ''A''&&*i<&eq; ''F''?*i+10-''A'':*i>&eq;''a''&&*i<&eq;''f''?*i+10-''a'':0);
               *j++ = (char) val ;
               continue ;
           }
       }
       *j++ = *i ;
   }
   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 ;
}