CTCLStdioCommander

Name

CTCLStdioCommander -- Event driven command input on stdin/stdout

Synopsis


#include <CTCLStdioCommander.h>
         
 class CTCLStdioCommander {

  CTCLStdioCommander(CTCLInterpreter* pInterp);

  virtual ~CTCLStdioCommander();

  virtual void sendPrompt(std::string prompt);
  virtual void returnResult();
}

Description

Provides a commander that can be hooked to the event loop to allow event loop driven applications to continue to process commands on stdin/stdout as interactive shells do.

Public member functions

CTCLStdioCommander(CTCLInterpreter* pInterp);

Constructs a commander. pInterp is the interpreter to which the complete commands will be submitted.

virtual void sendPrompt(std::string prompt);

Overrides the base class sendPrompt method by sending the requested prompt string to the Tcl_Channel Tcl has open on stdout. The channel is also flushed to ensure that the prompt is made immediately visible.

virtual void returnResult();

Overrides the base class member. Retrieves the result from the interpreter, appends a newline character and passes the resulting string to sendPrompt which makes the result visible on stdout.