|
OpenMW
|
Error handling. More...
#include <errorhandler.hpp>
Public Member Functions | |
| ErrorHandler () | |
| constructor More... | |
| virtual | ~ErrorHandler () |
| destructor More... | |
| bool | isGood () const |
| Was compiling successful? More... | |
| int | countErrors () const |
| Return number of errors. More... | |
| int | countWarnings () const |
| Return number of warnings. More... | |
| void | warning (const std::string &message, const TokenLoc &loc) |
| Generate a warning message. More... | |
| void | error (const std::string &message, const TokenLoc &loc) |
| Generate an error message. More... | |
| void | endOfFile () |
| Generate an error message for an unexpected EOF. More... | |
| virtual void | reset () |
| Remove all previous error/warning events. More... | |
| void | setWarningsMode (int mode) |
| // 0 ignore, 1 rate as warning, 2 rate as error More... | |
| void | downgradeErrors (bool downgrade) |
| Treat errors as warnings. More... | |
Protected Types | |
| enum | Type { WarningMessage, ErrorMessage } |
Private Member Functions | |
| virtual void | report (const std::string &message, const TokenLoc &loc, Type type)=0 |
| Report error to the user. More... | |
| virtual void | report (const std::string &message, Type type)=0 |
| Report a file related error. More... | |
Private Attributes | |
| int | mWarnings |
| int | mErrors |
| int | mWarningsMode |
| bool | mDowngradeErrors |
Error handling.
This class collects errors and provides an interface for reporting them to the user.
|
protected |
| Compiler::ErrorHandler::ErrorHandler | ( | ) |
constructor
|
virtual |
destructor
| int Compiler::ErrorHandler::countErrors | ( | ) | const |
Return number of errors.
| int Compiler::ErrorHandler::countWarnings | ( | ) | const |
Return number of warnings.
| void Compiler::ErrorHandler::downgradeErrors | ( | bool | downgrade | ) |
Treat errors as warnings.
| void Compiler::ErrorHandler::endOfFile | ( | ) |
Generate an error message for an unexpected EOF.
| void Compiler::ErrorHandler::error | ( | const std::string & | message, |
| const TokenLoc & | loc | ||
| ) |
Generate an error message.
| bool Compiler::ErrorHandler::isGood | ( | ) | const |
Was compiling successful?
|
privatepure virtual |
Report error to the user.
Implemented in MWGui::Console, CSMTools::ScriptCheckStage, CSVWorld::ScriptErrorTable, Compiler::StreamErrorHandler, and Compiler::NullErrorHandler.
|
privatepure virtual |
Report a file related error.
Implemented in MWGui::Console, CSMTools::ScriptCheckStage, CSVWorld::ScriptErrorTable, Compiler::StreamErrorHandler, and Compiler::NullErrorHandler.
|
virtual |
Remove all previous error/warning events.
| void Compiler::ErrorHandler::setWarningsMode | ( | int | mode | ) |
// 0 ignore, 1 rate as warning, 2 rate as error
| void Compiler::ErrorHandler::warning | ( | const std::string & | message, |
| const TokenLoc & | loc | ||
| ) |
Generate a warning message.
|
private |
|
private |
|
private |
|
private |
1.8.6