Page 1 of 1

[Snippet] Exec interface.

Posted: Fri Nov 06, 2015 3:04 pm
by han
When you have some special class (like a renderdevice, engine, etc.) you receive commands over the Exec interface. And basically it works like this. You create another pointer (Str) to the original command passed in. ParseCommand will change the position Str points to, so you loose parts of your Cmd, but if needed you can always use Cmd again. The second argument is where the output goes. For example if you type a command in the ingame console and log to Ar, it will show up there. Or you get it as return value when using the ConsoleCommand() function in UnrealScript.

Code: Select all

// FExec interface.
UBOOL URevisionContent::Exec( const TCHAR* Cmd, FOutputDevice& Ar )
{
      guard(URevisionContent::Exec);
      const TCHAR* Str = Cmd;
      if ( ParseCommand(&Str,TEXT("Content")) )
      {
            if ( ParseCommand(&Str,TEXT("List")) )
            {
                  Ar.Logf( TEXT("Contents:") );
                  {for ( INT i=0; i