本文整理汇总了C++中CScriptArgReader::Skip方法的典型用法代码示例。如果您正苦于以下问题:C++ CScriptArgReader::Skip方法的具体用法?C++ CScriptArgReader::Skip怎么用?C++ CScriptArgReader::Skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CScriptArgReader
的用法示例。
在下文中一共展示了CScriptArgReader::Skip方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toJSON
int CLuaFunctionDefs::toJSON ( lua_State* luaVM )
{
// Got a string argument?
CScriptArgReader argStream ( luaVM );
if ( !argStream.NextIsNil () )
{
bool bCompact = false;
// Read the argument
CLuaArguments JSON;
JSON.ReadArgument ( luaVM, 1 );
argStream.Skip ( 1 );
argStream.ReadBool ( bCompact, false );
if ( !argStream.HasErrors () )
{
// Convert it to a JSON string
std::string strJSON;
if ( JSON.WriteToJSONString ( strJSON, false, bCompact ) )
{
// Return the JSON string
lua_pushstring ( luaVM, strJSON.c_str () );
return 1;
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
}
else
m_pScriptDebugging->LogBadType ( luaVM );
// Failed
lua_pushnil ( luaVM );
return 1;
}
示例2: toJSON
int CLuaFunctionDefs::toJSON ( lua_State* luaVM )
{
// Got a string argument?
CScriptArgReader argStream ( luaVM );
if ( !argStream.NextIsNil () )
{
int jsonFlags = 0;
// Read the argument
CLuaArguments JSON;
JSON.ReadArgument ( luaVM, 1 );
argStream.Skip ( 1 );
bool bCompact;
argStream.ReadBool ( bCompact, false );
jsonFlags |= bCompact ? JSON_C_TO_STRING_PLAIN : JSON_C_TO_STRING_SPACED;
eJSONPrettyType jsonPrettyType;
argStream.ReadEnumString ( jsonPrettyType, JSONPRETTY_NONE );
if ( jsonPrettyType != JSONPRETTY_NONE )
jsonFlags |= jsonPrettyType;
if ( !argStream.HasErrors () )
{
// Convert it to a JSON string
std::string strJSON;
if ( JSON.WriteToJSONString ( strJSON, false, jsonFlags ) )
{
// Return the JSON string
lua_pushstring ( luaVM, strJSON.c_str () );
return 1;
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
}
else
m_pScriptDebugging->LogBadType ( luaVM );
// Failed
lua_pushnil ( luaVM );
return 1;
}
示例3: OutputChatBox
int CLuaFunctionDefs::OutputChatBox ( lua_State* luaVM )
{
// bool outputChatBox ( string text [, element visibleTo=getRootElement(), int r=231, int g=217, int b=176, bool colorCoded=false ] )
SString ssChat;
CElement* pElement;
bool bColorCoded;
// Default
unsigned char ucRed = 231;
unsigned char ucGreen = 217;
unsigned char ucBlue = 176;
CScriptArgReader argStream ( luaVM );
argStream.ReadString ( ssChat );
argStream.ReadUserData ( pElement, m_pRootElement );
if ( argStream.NextIsNumber () && argStream.NextIsNumber ( 1 ) && argStream.NextIsNumber ( 2 ) )
{
argStream.ReadNumber ( ucRed );
argStream.ReadNumber ( ucGreen );
argStream.ReadNumber ( ucBlue );
}
else
argStream.Skip ( 3 );
argStream.ReadBool ( bColorCoded, false );
if ( !argStream.HasErrors () )
{
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
if ( pLuaMain )
{
CStaticFunctionDefinitions::OutputChatBox ( (const char*) ssChat, pElement, ucRed, ucGreen, ucBlue, bColorCoded, pLuaMain );
lua_pushboolean ( luaVM, true );
return 1;
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
lua_pushboolean ( luaVM, false );
return 1;
}
示例4: OOP_OutputChatBox
int CLuaFunctionDefs::OOP_OutputChatBox ( lua_State * luaVM )
{
// bool Player:outputChat ( string text [, int r=231, int g=217, int b=176, bool colorCoded=false ] )
CElement* pElement; SString strText; uchar ucRed = 231; uchar ucGreen = 217; uchar ucBlue = 176; bool bColorCoded;
CScriptArgReader argStream ( luaVM );
argStream.ReadUserData ( pElement );
argStream.ReadString ( strText );
if ( argStream.NextIsNumber ( 0 ) && argStream.NextIsNumber ( 1 ) && argStream.NextIsNumber ( 2 ) )
{
argStream.ReadNumber ( ucRed );
argStream.ReadNumber ( ucGreen );
argStream.ReadNumber ( ucBlue );
}
else
argStream.Skip ( 3 );
argStream.ReadBool ( bColorCoded, false );
if ( !argStream.HasErrors () )
{
CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM );
if ( pLuaMain )
{
CStaticFunctionDefinitions::OutputChatBox ( strText, pElement, ucRed, ucGreen, ucBlue, bColorCoded, pLuaMain );
lua_pushboolean ( luaVM, true );
return 1;
}
}
else
m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () );
lua_pushboolean ( luaVM, false );
return 1;
}