Command/LuaManager: add legacy command parsing

Only enabled when compiling via CompileXNodeTree.
This commit is contained in:
Devin J. Pohly
2014-02-20 10:59:49 -05:00
parent c9ac7e7a53
commit a9d5931533
9 changed files with 41 additions and 15 deletions
+6 -3
View File
@@ -87,10 +87,13 @@ RString Commands::GetOriginalCommandString() const
return s;
}
void ParseCommands( const RString &sCommands, Commands &vCommandsOut )
void ParseCommands( const RString &sCommands, Commands &vCommandsOut, bool bLegacy )
{
vector<RString> vsCommands;
SplitWithQuotes( sCommands, ';', vsCommands, true ); // do ignore empty
if( bLegacy )
split( sCommands, ";", vsCommands, true );
else
SplitWithQuotes( sCommands, ';', vsCommands, true ); // do ignore empty
vCommandsOut.v.resize( vsCommands.size() );
for( unsigned i=0; i<vsCommands.size(); i++ )
@@ -103,7 +106,7 @@ void ParseCommands( const RString &sCommands, Commands &vCommandsOut )
Commands ParseCommands( const RString &sCommands )
{
Commands vCommands;
ParseCommands( sCommands, vCommands );
ParseCommands( sCommands, vCommands, false );
return vCommands;
}