FACT++  1.0
void Readline::ProcessLine ( const std::string &  str)

Process a single line. All lines are added to the history, but only accepted lines are written to the command log. In this case fLine is increased by one. Comment (starting with #) are removed from the command-line. A # can be escaped with quotation marks "#"

Definition at line 1370 of file Readline.cc.

References AddToHistory(), fCommandLog, fLine, PreProcess(), and Tools::Uncomment().

Referenced by Execute(), GetUpdatePrompt(), ConsoleStream::Run(), and Run().

1371 {
1372  const string cmd = Tools::Uncomment(str);
1373 
1374  if (!cmd.empty())
1375  {
1376  const bool rc = PreProcess(cmd);
1377 
1378  AddToHistory(cmd);
1379 
1380  if (rc)
1381  return;
1382 
1383  fLine++;
1384  }
1385 
1386  fCommandLog << str << endl;
1387 }
char str[80]
Definition: test_client.c:7
std::ofstream fCommandLog
Maximum number of lines in the history file.
Definition: Readline.h:25
int fLine
Last line adde to history.
Definition: Readline.h:29
std::string Uncomment(const std::string &opt)
Definition: tools.cc:292
virtual bool PreProcess(const std::string &str)
Definition: Readline.cc:1049
void AddToHistory(const std::string &str, int skip=2)
Definition: Readline.cc:562

+ Here is the call graph for this function:

+ Here is the caller graph for this function: