FACT++  1.0
bool Shell::Process ( const std::string &  str)
virtual

Processes the command provided by the Shell-class.

Returns
whether a command was successfully processed or could not be found

Reimplemented from Readline.

Reimplemented in RemoteControl< Shell >, LocalControl< Shell >, and ChatClient< Shell >.

Definition at line 451 of file Shell.cc.

References WindowLog::Display(), ReadlineColor::Process(), Readline::Process(), Readline::Resize(), ShowHide(), win, and wout.

Referenced by PrintCommands().

452 {
453  // Implement readline commands:
454  // rl set (rl_variable_bind(..))
455  // rl_read_init_file(filename)
456  // int rl_add_defun (const char *name, rl_command_func_t *function, int key)
457 
459  return true;
460 
461  if (Readline::Process(str))
462  return true;
463 
464  // ----------- ReadlineNcurses -----------
465 
466  if (string(str)=="hide")
467  {
468  ShowHide(0);
469  return true;
470  }
471  if (string(str)=="show")
472  {
473  ShowHide(1);
474  return true;
475  }
476 
477  if (str.substr(0, 7)=="height ")
478  {
479  int h;
480  sscanf(str.c_str()+7, "%d", &h);
481  return Resize(h);
482  }
483 
484  if (str=="d")
485  {
486  wout.Display();
487  return true;
488  }
489 
490  return false;
491 }
static void Resize()
Definition: Readline.cc:816
WindowLog win
pointer to our glocal object to get the static member functions into scope
Definition: Shell.h:17
char str[80]
Definition: test_client.c:7
virtual bool Process(const std::string &str)
Definition: Readline.cc:1094
void ShowHide(int v)
Definition: Shell.cc:207
bool Process(std::ostream &out, const std::string &str)
WindowLog wout
Definition: Shell.h:18
void Display(bool empty=false)
Display backlog.
Definition: WindowLog.cc:46

+ Here is the call graph for this function:

+ Here is the caller graph for this function: