Return TypeFunction nameArguments
unsigned intErsatz(hzChain&,hzString&,hzString&,bool,)

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

Function Logic:

0:START 1:!from 2:Return -1 3:!to 4:Return -1 5:!Z.Size() 6:Return 0 7:bCase 8:!zi.eof(); 9:zi==from 10:items items hzString::Length zi 11:hzChain::AddByte items 12:!zi.eof(); 13:zi.Equiv(from) 14:items items hzString::Length zi 15:hzChain::AddByte items 16:hzChain::Clear Z 17:Return nSubs

Function body:

unsigned int Ersatz (hzChain& Z, hzString& from, hzString& to, bool bCase)
{
   _hzfunc("Ersatz1") ;
   chIter      zi ;
   hzChain     F ;
   uint32_t    nSubs = 0;
   if (!from)  return -1;
   if (!to)    return -1;
   if (!Z.Size())
       return 0;
   if (bCase)
   {
       for (zi = Z ; !zi.eof() ;)
       {
           if (zi == from)
               { nSubs++ ; F << to ; zi += from.Length() ; continue ; }
           F.AddByte(*zi) ;
           zi++ ;
       }
   }
   else
   {
       for (zi = Z ; !zi.eof() ;)
       {
           if (zi.Equiv(from))
               { nSubs++ ; F << to ; zi += from.Length() ; continue ; }
           F.AddByte(*zi) ;
           zi++ ;
       }
   }
   Z.Clear() ;
   Z = F ;
   return nSubs ;
}