本文整理汇总了C++中MOAILuaStateHandle::PrintErrors方法的典型用法代码示例。如果您正苦于以下问题:C++ MOAILuaStateHandle::PrintErrors方法的具体用法?C++ MOAILuaStateHandle::PrintErrors怎么用?C++ MOAILuaStateHandle::PrintErrors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MOAILuaStateHandle
的用法示例。
在下文中一共展示了MOAILuaStateHandle::PrintErrors方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AKURunString
//----------------------------------------------------------------//
void AKURunString ( const char* script ) {
int status;
MOAILuaStateHandle state = MOAILuaRuntime::Get ().State ();
status = luaL_loadstring ( state, script );
if ( state.PrintErrors ( USLog::CONSOLE, status )) return;
state.DebugCall ( 0, 0 );
}
示例2: AKURunScript
//----------------------------------------------------------------//
void AKURunScript ( const char* filename ) {
if ( !USFileSys::CheckFileExists ( filename )) return;
int status;
MOAILuaStateHandle state = MOAILuaRuntime::Get ().State ();
status = luaL_loadfile ( state, filename );
if ( state.PrintErrors ( USLog::CONSOLE, status )) return;
state.DebugCall ( 0, 0 );
}
示例3: SerializeFromFile
//----------------------------------------------------------------//
u32 MOAIDeserializer::SerializeFromFile ( cc8* filename ) {
this->Clear ();
int status;
MOAILuaStateHandle state = MOAILuaRuntime::Get ().State ();
// load the lua file
status = luaL_loadfile ( state, filename );
if ( state.PrintErrors ( USLog::CONSOLE, status )) return LOAD_ERROR;
// load self as the func param
this->PushLuaUserdata ( state );
// call the chunk
if ( state.DebugCall ( 1, 0 )) return LUA_ERROR;
lua_gc ( state, LUA_GCCOLLECT, 0 );
// done!
return SUCCESS;
}