Return TypeFunction nameArguments
hzStringhzString::SubString(unsigned int,unsigned int,)

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

Function Logic:

0:START 1:!m_addr 2:Return Dest 3:_strXlate thisCtl hzString::Length nRemainder 4:nRemainder<=0 5:Return Dest 6:nBytes==0 7:nBytes 8:nBytes>nRemainder 9:nBytes 10:_strAlloc Dest 11:!Dest.m_addr 12:hzexit 13:_strXlate destCtl _strItem::_setSize _strItem::_data _strItem::_data memcpy destCtl 14:Return Dest

Function body:

hzString hzString::SubString (unsigned int nPosn, unsigned int nBytes)
{
   _hzfunc("hzString::SubString") ;
   _strItem*       thisCtl ;
   _strItem*       destCtl ;
   hzString    Dest ;
   uint32_t    nRemainder ;
   if (!m_addr)
       return Dest ;
   thisCtl = (_strItem*) _strXlate(m_addr) ;
   nRemainder = Length() - nPosn ;
   if (nRemainder <&eq; 0)
       return Dest ;
   if (nBytes == 0)
       nBytes = nRemainder ;
   if (nBytes > nRemainder)
       nBytes = nRemainder ;
   Dest.m_addr = _strAlloc(nBytes) ;
   if (!Dest.m_addr)
       hzexit(E_MEMORY, "Buffer of (%d) bytes", nBytes) ;
   destCtl = (_strItem*) _strXlate(Dest.m_addr) ;
   destCtl->_setSize(nBytes) ;
   memcpy(destCtl->_data(), thisCtl->_data() + nPosn, nBytes) ;
   destCtl->m_copy = 1;
   return Dest ;
}