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