CFugue
Public Member Functions | Public Attributes | List of all members
CFugue::CParser::ErrorEventHandlerArgs Struct Reference

#include <Parser.h>

Inherits OIL::CEventHandlerArgs.

Public Member Functions

 ErrorEventHandlerArgs (ErrorCode argErrCode, const TCHAR *argErrMsg, const TCHAR *argSzToken)
 

Public Attributes

const ErrorCode errCode
 Error Code.
 
const TCHAR * szErrMsg
 The Error message sent by Parser.
 
const TCHAR * szToken
 Token the error is applicable for.
 
bool bShouldStopParsing
 Should Parser continue to parse or should stop now? (only for PARSE_ERRORS)
 

Detailed Description

The structure that is passed as argument to the Error Event Handler procedure. Listeners who want to know about the error events can subscribe to the evError event and handle the trace events raised by MusicStringParser as the parsing progresses.

Unlike the other programming paradigms that teach greedy methods asking you to exit the moment any error occurs, CFugue library fights to live its best before it gives up. So, usually if there is any error in parsing a token, parser does not abort and tries to continue parsing the rest of the tokens. In case this behavior is not suitable for your application and if you would like to stop the processing immediately when there is an error, you can indicate your preference to stop the processing by using the

variable. Set it to true in the error handler procedure, to halt the processing immediately. By default it would be False (meaning the parser should continue its best to resolve the token ignoring the error).

Note that, when there are multiple listeners for the event, options set by one listener might be overriden by the next listener. Parser only respects the last value it sees. So, use care while dealing with multiple listeners, and ensure that they do not use conflicting settings.

Ofcourse, in case of critical errors such as memory allocation failure etc.. there is nothing that could be done, so the listener preferences are ignored and processing would be stopped.

Definition at line 170 of file Parser.h.


The documentation for this struct was generated from the following file:

CFugue, the C++ Music Programming Library © Copyright 2009 Cenacle Research India Private Limited Gopalakrishna Palem