FACT++  1.0
template<class T >
void RunShell ( Configuration conf)

Definition at line 10 of file chatclient.cc.

References Configuration::Get(), Configuration::GetName(), Configuration::Has(), kRed, and WindowLog::OpenLogFile().

11 {
12  // A normal kill will call its destructor! (Very nice feature ;) )
13  static T shell(conf.GetName().c_str(), conf.Get<int>("console")!=1);
14 
15  WindowLog &win = shell.GetStreamIn();
16  WindowLog &wout = shell.GetStreamOut();
17 
18  if (conf.Has("log"))
19  if (!wout.OpenLogFile(conf.Get<string>("log")))
20  win << kRed << "ERROR - Couldn't open log-file " << conf.Get<string>("log") << ": " << strerror(errno) << endl;
21 
22  shell.Run();
23 }
A C++ ostream to an ncurses window supporting attributes and colors.
Definition: WindowLog.h:50
T Get(const std::string &var)
Set color Red.
Definition: WindowLog.h:17
bool Has(const std::string &var)
bool OpenLogFile(const std::string &filename, bool append=false)
Open a log-file.
Definition: WindowLog.cc:111
const std::string & GetName() const

+ Here is the call graph for this function: