| Return Type | Function name | Arguments |
|---|---|---|
| unsigned int | Ersatz | (hzChain&,hzString&,hzString&,bool,) |
Declared in file: hzTextproc.h
Defined in file : hzTextproc.cpp
Function Logic:
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 ;
}