本文整理汇总了C++中ErrorHandler类的典型用法代码示例。如果您正苦于以下问题:C++ ErrorHandler类的具体用法?C++ ErrorHandler怎么用?C++ ErrorHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ErrorHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: symbol
DecimalInputSymbolRef::DecimalInputSymbolRef(InputSource& input,
Array<Action*>& actions,
ErrorHandler& errorHandler,
OptionParameters& optionParameters,
Symbols& symbols,
unsigned long& timeOfOptionExecution,
unsigned long& timeOfStateExecution) :
symbol(0), parameters(0)
{
char buf[100];
input.readString(buf,99);
XABSL_DEBUG_INIT(errorHandler.message("creating a reference to decimal input symbol \"%s\"",buf));
if (!symbols.decimalInputSymbols.exists(buf))
{
errorHandler.error("XabslDecimalInputSymbolRef::DecimalInputSymbolRef(): decimal input symbol \"%s\" was not registered",buf);
return;
}
symbol = symbols.decimalInputSymbols[buf];
parameters = new ParameterAssignment(&symbol->parameters, errorHandler);
parameters->create(input, optionParameters, symbols, timeOfOptionExecution, timeOfStateExecution, actions);
}
示例2: executeSchemaTest
TestResult::List XSDTSTestCase::execute(const ExecutionStage, TestSuite*)
{
ErrorHandler errHandler;
ErrorHandler::installQtMessageHandler(&errHandler);
TestResult::List retval;
TestResult::Status resultStatus = TestResult::Unknown;
QString serialized;
if (m_testType == SchemaTest) {
executeSchemaTest(resultStatus, serialized, &errHandler);
} else {
executeInstanceTest(resultStatus, serialized, &errHandler);
}
resultStatus = TestBaseLine::scan(serialized, baseLines());
Q_ASSERT(resultStatus != TestResult::Unknown);
m_result = new TestResult(name(), resultStatus, 0, errHandler.messages(),
QPatternist::Item::List(), serialized);
retval.append(m_result);
ErrorHandler::installQtMessageHandler(0);
changed(this);
return retval;
}
示例3: createOperand
bool EnumeratedExpression::createOperand(const EnumeratedExpression*& operand,
const Enumeration* enumeration,
InputSource& input,
ErrorHandler& errorHandler,
Symbols& symbols,
Option& option,
State& state)
{
operand = EnumeratedExpression::create(enumeration, input, errorHandler, symbols, option, state);
if(operand == 0)
{
errorHandler.error("XabslEnumeratedExpression::createOperand(): created operand is 0");
return false;
}
if(errorHandler.errorsOccurred)
{
errorHandler.error("XabslEnumeratedExpression::createOperand(): could not create operand");
if(operand != 0) delete operand;
return false;
}
return true;
}
示例4: symbol
EnumeratedInputSymbolRef::EnumeratedInputSymbolRef(const Enumeration* enumeration,
InputSource& input,
ErrorHandler& errorHandler,
Symbols& symbols,
Option& option,
State& state) :
symbol(0), parameters(0)
{
char buf[100];
input.readString(buf, 99);
XABSL_DEBUG_INIT(errorHandler.message("creating reference to enumerated input symbol \"%s\"", buf));
if(!symbols.enumeratedInputSymbols.exists(buf))
{
errorHandler.error("XabslEnumeratedInputSymbolRef::XabslEnumeratedInputSymbolRef(): enumerated input symbol \"%s\" was not registered at the engine", buf);
return;
}
symbol = symbols.enumeratedInputSymbols[buf];
this->enumeration = symbol->enumeration;
if(enumeration != NULL && enumeration != this->enumeration)
{
errorHandler.error("XabslEnumeratedInputSymbolRef::XabslEnumeratedInputSymbolRef(): enumeration input symbol \"%s\" does not match enumeration type \"%s\"", buf, enumeration->n);
}
parameters = new ParameterAssignment(&symbol->parameters, errorHandler);
parameters->create(input, symbols, option, state);
}
示例5: theParser
/**
This is the entry point for parsing when you have source stream and the textual name
of that stream, and is also called
*/
bool ZASParser::sParse(const ZFileSpec& iFileSpec, const ZStreamR& iStream, ParseHandler& iParseHandler,
const StreamProvider& iStreamProvider,
const ErrorHandler& iErrorHandler, IncludeHandler* iIncludeHandler)
{
try
{
Parser theParser(iParseHandler, iStreamProvider, iErrorHandler, iIncludeHandler);
iParseHandler.StartParse();
theParser.Parse(iFileSpec, iStream);
iParseHandler.EndParse();
return true;
}
catch (NestedParse& ex)
{
printf("EX4\n");
iErrorHandler.ReportError(ex.GetSources(), ex.GetMessage());
}
catch (exception& ex)
{
printf("EX5\n");
iErrorHandler.ReportError(ex.what());
}
catch (...)
{
iErrorHandler.ReportError("Unknown exception");
}
return false;
}
示例6: parseObject
inline Iterator parseObject(Iterator begin, Iterator end, ObjectBodyParser objectBodyParser, ErrorHandler &errorHandler)
{
Iterator i = skipLeadingSpaces<spacePolicy>(begin, end);
if (unlikely(i == end)) {
goto prematureEnd;
}
if (unlikely(*i != u8"{"[0])) {
goto malformedJson;
}
i = objectBodyParser(++i, end, errorHandler);
if (unlikely(!errorHandler.valid())) {
return end;
}
if (unlikely(i == end)) {
goto prematureEnd;
}
if (unlikely(*i != u8"}"[0])) {
goto malformedJson;
}
return skipTrailingSpaces<spacePolicy>(++i, end);
prematureEnd:
errorHandler.prematureEnd();
return end;
malformedJson:
errorHandler.malformedJson(i);
return end;
}
示例7: import
bool DocumentImporter::import()
{
ErrorHandler errorHandler;
COLLADASaxFWL::Loader loader(&errorHandler);
COLLADAFW::Root root(&loader, this);
ExtraHandler *ehandler = new ExtraHandler(this, &(this->anim_importer));
loader.registerExtraDataCallbackHandler(ehandler);
if (!root.loadDocument(mFilename))
return false;
if(errorHandler.hasError())
return false;
/** TODO set up scene graph and such here */
mImportStage = Controller;
COLLADASaxFWL::Loader loader2;
COLLADAFW::Root root2(&loader2, this);
if (!root2.loadDocument(mFilename))
return false;
delete ehandler;
return true;
}
示例8: ifCondition
IfElseBlock::IfElseBlock(InputSource& input,
ErrorHandler& errorHandler,
Symbols& symbols,
Option& option,
State& state) :
ifCondition(0), ifStatement(0), elseStatement(0)
{
// if case
XABSL_DEBUG_INIT(errorHandler.message("creating if statement"));
ifCondition = BooleanExpression::create(input, errorHandler, symbols, option, state);
if(errorHandler.errorsOccurred)
{
errorHandler.error("XabslIfElseBlock::IfElseBlock(): could not create if condition");
return;
}
ifStatement = Statement::createStatement(input, errorHandler, symbols, option, state);
if(errorHandler.errorsOccurred)
{
errorHandler.error("XabslIfElseBlock::IfElseBlock(): could not create if statement");
return;
}
// else case
XABSL_DEBUG_INIT(errorHandler.message("creating else statement"));
elseStatement = Statement::createStatement(input, errorHandler, symbols, option, state);
if(errorHandler.errorsOccurred)
errorHandler.error("XabslIfElseBlock::IfElseBlock(): could not create else statement");
}
示例9: createOperand
bool DecimalExpression::createOperand(DecimalExpression*& operand,
InputSource& input,
Array<Action*>& actions,
ErrorHandler& errorHandler,
OptionParameters& parameters,
Symbols& symbols,
unsigned long& timeOfOptionExecution,
unsigned long& timeOfStateExecution)
{
operand = DecimalExpression::create(input,actions,errorHandler,parameters, symbols,
timeOfOptionExecution,timeOfStateExecution);
if (operand == 0)
{
errorHandler.error("XabslDecimalExpression::createOperand(): created operand is 0");
return false;
}
if (errorHandler.errorsOccurred)
{
errorHandler.error("XabslDecimalExpression::createOperand(): could not create operand");
if (operand != 0) delete operand;
return false;
}
return true;
}
示例10: notice_trampoline
static void GEOS_DLL notice_trampoline(const char* message, void* userdata)
{
ErrorHandler* debug =
static_cast<ErrorHandler*>(userdata);
if (!debug)
return;
debug->m_geos_callback(message);
if (!debug->m_log->get()) return;
}
示例11: load
Penjin::ERRORS Text::load(CRstring name,CRuint fontSize)
{
ErrorHandler* eMan = ErrorMan::getInstance();
// check if fontSize is not the same as loaded font
if(this->fontSize != fontSize || name != getFileName())
{
clear();
#if PLATFORM_WII
font = TTF_OpenFont((Penjin::getWorkingDirectory() + name).c_str(), fontSize);
#else
font = TTF_OpenFont(name.c_str(), fontSize);
#endif
}
if(font)
{
setFileName(name);
// check if we already have Glyphs for this fontSize
if(glyphs.size() >= fontSize)
{
if(glyphs.at(fontSize-1).size())
{
// if the fontSize checks out...
if(glyphs.at(fontSize-1)[0]->getFontSize() == fontSize)
{
this->fontSize = fontSize;
#ifdef _DEBUG
eMan->print(PENJIN_OK,"Text: font loaded, Size: " + StringUtility::intToString(fontSize) + "Font: " + name);
#endif
return PENJIN_OK;
}
}
}
else
{
//Setup enough glyphs for fontSize
glyphs.resize(fontSize);
}
// create Dummy Char for spacing calcs
glyphs[fontSize-1].push_back(NULL);
glyphs[fontSize-1][0] = new Glyph();
glyphs[fontSize-1][0]->setFontSize(fontSize);
glyphs[fontSize-1][0]->setFont(font);
glyphs[fontSize-1][0]->setCharacter('-'); // picked because a nice square char to give us a "standard surface width"
glyphs[fontSize-1][0]->setPosition(cursorPos.getPosition());
glyphs[fontSize-1][0]->refresh();
setFileName(name);
this->fontSize = fontSize;
#ifdef _DEBUG
eMan->print(PENJIN_OK,"Text: font loaded, Size: " + StringUtility::intToString(fontSize) + "Font: " + name);
#endif
return PENJIN_OK;
}
eMan->print(PENJIN_TTF_UNABLE_TO_OPEN,"Text: Size: " + StringUtility::intToString(fontSize) + "Font: " + name);
return PENJIN_TTF_UNABLE_TO_OPEN;
}
示例12: setErrorHandler
Error CodeGen::setErrorHandler(ErrorHandler* handler) {
ErrorHandler* oldHandler = _errorHandler;
if (oldHandler != NULL)
oldHandler->release();
if (handler != NULL)
handler = handler->addRef();
_errorHandler = handler;
return kErrorOk;
}
示例13: parseComma
inline Iterator parseComma(Iterator begin, Iterator end, ErrorHandler &errorHandler)
{
Iterator i = skipLeadingSpaces<spacePolicy>(begin, end);
if (unlikely(i == end)) {
errorHandler.prematureEnd();
return end;
}
if (unlikely(*i != u8","[0])) {
errorHandler.malformedJson(i);
return i;
}
return skipTrailingSpaces<spacePolicy>(++i, end);
}
示例14:
DecimalValue::DecimalValue(InputSource& input,
ErrorHandler& errorHandler)
{
value = input.readValue();
XABSL_DEBUG_INIT(errorHandler.message("created decimal value: \"%.2f\"",value));
}
示例15: put
inline void put ( Reader reader, ErrorHandler handler )
{
const com::Result result = reader->putErrorHandler(handler.value());
if ( result.bad() ) {
UNCHECKED_COM_ERROR(ISAXXMLReader, putErrorHandler, result);
}
}