Convert textual representation of a periodicity (eg from a config file) into a hzPeriodicity enum value.
| Return Type | Function name | Arguments |
|---|---|---|
| hzPeriodicity | Str2Periodicity | (hzString&,) |
Declared in file: hzCron.h
Defined in file : hzCron.cpp
Function Logic:
Function body:
hzPeriodicity Str2Periodicity (hzString& P)
{
// Category: Config
//
// Convert textual representation of a periodicity (eg from a config file) into a hzPeriodicity enum value.
//
// Arguments: 1) P String assumed to be the name of a valid hzPeriodicity value
//
// Returns: Enum hzPeriodicity
uint32_t nIndex ; // Periodicity iterator
if (!P)
return HZPERIOD_INVALID ;
for (nIndex = 0; _hzGlobal_Periodicities[nIndex] ; nIndex++)
{
if (P.Equiv(_hzGlobal_Periodicities[nIndex]))
return (hzPeriodicity) nIndex ;
}
return HZPERIOD_INVALID ;
}