Process the supplied data (assumed to be text) by replacing any incident percent entities by thier 'here and now' values. The data is supplied as a chain which remains in situ and will be unchanged if there are no succesful percent entity conversions. Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | hdsApp::ConvertText | (hzChain&,hzHttpEvent*,) |
Declared in file: hzDissemino.h
Defined in file : hdsSystem.cpp
Function Logic:
Function body:
void hdsApp::ConvertText (hzChain& Z)hzHttpEvent* pE,
{
// Process the supplied data (assumed to be text) by replacing any incident percent entities by thier 'here and now' values. The data is supplied
// as a chain which remains in situ and will be unchanged if there are no succesful percent entity conversions.
//
// Arguments: 1) Z Data to be treated as text which may contain one or more percent entities.
// 2) pE The HTTP event from which the non system and non user variables can be garnered or from which the user can be established.
//
// Returns: None
_hzfunc("hdsApp::ConvertText(1)") ;
hzChain W ; // Variable name buffer
hzChain C ; // Final value
chIter zi ; // Interation of contnt
hzAtom atom ; // User profile record variable
hzString pcntEnt ; // Constructed variable name
hzEcode rc ; // Variable location. 1 system, 2 event, 3 session, 4 user value (must be logged in with session & cookie)
if (!Z.Size())
return ;
for (zi = Z ; !zi.eof() ;)
{
if (*zi == CHAR_AT)
{
if (zi == "@resarg;")
{
if (pE->m_Resarg)
C << pE->m_Resarg ;
zi += 8;
continue ;
}
}
if (*zi == CHAR_PERCENT)
{
if (zi[1]== CHAR_PERCENT)
{ C << "%%" ; zi += 2; continue ; }
if (IsAlpha(zi[1])&& zi[2]== CHAR_COLON && IsAlpha(zi[3]))
{
if (AtPcEnt(pcntEnt, zi))
{
rc = PcEntConv(atom, pcntEnt, pE) ;
if (atom.Type() != BASETYPE_UNDEF)
{
if (atom.IsSet())
C << atom.Str() ;
}
else
{
m_pLog->Log("Atom type unknown %s\n", *pcntEnt) ;
C << pcntEnt ;
}
zi += pcntEnt.Length() ;
continue ;
}
}
}
C.AddByte(*zi) ;
zi++ ;
}
Z.Clear() ;
Z = C ;
}