| Return Type | Function name | Arguments |
|---|---|---|
| hzString& | hzString::ToUpper | (void) |
Declared in file: hzString.h
Defined in file : hzString.cpp
Function Logic:
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 ;
}