Determine if the supplied chain iterator is at the start of a percent entity and if it is, populate the supplied string (arg 1) with the entity
| Return Type | Function name | Arguments |
|---|---|---|
| bool | hdsApp::AtPcEnt | (hzString&,hzChain::Iter&,) |
Declared in file: hzDissemino.h
Defined in file : hdsSystem.cpp
Function Logic:
Function body:
bool hdsApp::AtPcEnt (hzString& pcntEnt)hzChain::Iter& input,
{
// Determine if the supplied chain iterator is at the start of a percent entity and if it is, populate the supplied string (arg 1) with the entity
//
// Arguments: 1) pcntEnt The hzString to contain the entity
// 2) input The input text
//
// Returns: True If a percent entity is found
// False Otherwise
_hzfunc("hdsApp::AsPcEnt") ;
hzChain W ; // Chain to build entity
chIter zi ; // Temp iterator
uint32_t c = 0; // Char count
pcntEnt.Clear() ;
zi = input ;
if (*zi != CHAR_PERCENT)
return false ;
W.AddByte(CHAR_PERCENT) ;
zi++ ;
if (*zi != ''x''&&*zi != ''e''&&*zi != ''s''&&*zi != ''u'')
return false ;
W.AddByte(*zi) ;
zi++ ;
if (*zi != CHAR_COLON)
return false ;
W.AddByte(CHAR_COLON) ;
// Get the variable type and name component
for (zi++ ; !zi.eof() && *zi != CHAR_SCOLON && IsAlpha(*zi) ; c++, zi++)
W.AddByte(*zi) ;
if (c && *zi == CHAR_PERIOD)
{
W.AddByte(*zi) ;
for (zi++ ; !zi.eof() && *zi != CHAR_SCOLON && IsAlpha(*zi) ; zi++)
W.AddByte(*zi) ;
}
if (c && *zi == CHAR_SCOLON)
W.AddByte(*zi) ;
else
c = 0;
if (c)
pcntEnt = W ;
W.Clear() ;
return c ? true : false ;
}