|
CRegExpression class |
Pipelines v1.6 |
|
Description |
The CregExpression class object is used by
the ParseForRegExp()
function to validate and assign a regular expression that has been extracted
from your stage command argument. The format of the regular expression is
determined by the Pipelines REGEXP option mode
setting. However, this is transparent to the stage designer; the format of an
expression only applies to the way it is specified as a stage command argument.
The ParseForRegExp() function determines the format
automatically; extracts the argument and passes it to the regular expression
parser for validation and assignment.
|
Definition |
The following class definition is an edited
version; it details only those members which are accessible and of use to you.
In addition; any examples that may be shown are only intended as a
demonstration of how certain functions might be used, they do not represent
best practice nor do they take into account the scope and de-allocation of
class objects.
class CRegExpression
{ public: RegularExpression m_RegExp;};
|
Member variables |
|
● |
RegularExpression m_RegExp[in] is the interface to the regular expression parser.
First,
you extract the string which specifies the regular expression definition;
this will be in the form of a simple delimited character string. Then, you
present this string to the regular expression parser for evaluation and
assignment. For example: bool CMyStage::Initialise( void ) { // Access the manager.CStageManager *pManager = Manager(); // Access my stage. CStage *pStage = pManager->GetStage( *this ); ... // Point to my stage command argument. const char *pszArgument = pStage->Argument(); // Perform any preprocessing required.if( !pManager->PreProcess( *this, &pszArgument ) ) return( false ); CString szString; CCharacterString *pCharString = new CCharacterString( *this );pCharString->m_bRequired = true; pCharString->m_pszSource = &pszArgument; pCharString->m_pszTarget = &szString; // Extract the regular expression. if( !pManager->ParseForCharacterString( pCharString ) ) return( false ); // Parse and assign the regular expression. CRegExpression *pRegExp = new CRegExpression;pRegExp->m_RegExp.Expression = szString; if( !pManager->ParseForRegExp( *this, pRegExp, !pStage->Casei() ) ) return( false ); ... return( true );} |
|
Member functions |
None.
|
|