9 const size_t p1 = str.find_first_of(
' ');
10 const size_t p2 = str.find_first_of(
'/');
12 const bool is_cmd = p2!=string::npos && p1>p2;
16 s = str.substr(0, p2);
18 if (p2<p1 && p2!=str.length()-1)
20 const string c = str.substr(p2+1);
33 if (!change && is_cmd)
34 throw runtime_error(
"Unkown server '"+s+
"'");
37 lout <<
kRed <<
"Unkown server '" << s <<
"'" << endl;
56 if (fImp->GetCurrentState()>=3)
61 const string beg = GetLinePrompt();
69 if (state.
index==-256)
77 return beg +
" " + serv +
"> ";
80 return beg +
" " + serv +
":\033[32m\033[1m" + state.
name +
"\033[0m> ";
87 const string beg = GetLinePrompt();
94 if (state.
index==-256)
102 return beg +
" " + fCurrentServer +
":" + state.
name +
"> ";
virtual bool HasServer(const std::string &)
string GetUpdatePrompt() const
string GetUpdatePrompt() const
std::ostream & lout
Output stream for local synchrounous output.
bool ProcessCommand(const std::string &str, bool change=true)
std::string fCurrentServer
Output stream for local synchrounous output.
virtual bool SendDimCommand(ostream &, const std::string &, const std::string &, bool=false)
std::string name
Index (e.g. 1)