CRgProcessor Class
class CRgProcessor: public CRgChange
Class that contains the scan states. This class also drives the compilation and the scanning of tokens. Operations on this class may cause a CRgProcessException exception to be thrown. This class derives from exception.
Defined in: rgprocess.h
Class Members
Creation/Initialization
CRgProcessor(CRgState* pState = NULL)
Constructs a CRgProcessor object
public
bool AddListener(CRgDefListener* pListener)
Call this function to add a CRgDefListener derived listener class that will receive notifications about the scan process.
bool RemoveListener(CRgDefListener* pListener)
Call this function to remove a previously added CRgDefListener derived listener class
bool RemoveAllListeners()
Call this function to remove all previously added CRgDefListener derived listener classes
virtual bool Compile()
Calling this function performs a simple compilation step that speeds up operations when scanning for tokens. This is a required call before ProcessData can be called.
virtual bool ProcessData(const CRgString& strData)
Call this function to process the supplied data (strData) and extract the tokens specified previously
void SavePos(LPCTSTR pszStateName, CRgString::const_iterator citpos)
Save any position that you can return to later
void RemovePos(LPCTSTR pszStateName)
Remove a previously saved position
void RemoveAllPos()
Remove all previously saved positions
void SetActivePosName(LPCTSTR pszPosName)
Sets the active position to be the position saved under strPosName This will be where the next scan starts.
void SetActivePos(CRgString::const_iterator citpos)
Sets the active position to be the specified one. This will be where the next scan starts.
virtual void Initialize()
You must override this function and add in all the states/substates that this processor is responsible for. Use macros such as rg_start_processor to add the states and the substate. Please refer to the deals sample for information on how this is usually done.