1 #include "../include/commandthread.h"
\r
2 #include "../include/stringfunctions.h"
\r
10 void CommandThread::HandleHelpCommand()
\r
12 std::cout << "Available Commands:" << std::endl;
\r
13 std::cout << "QUIT End program" << std::endl;
\r
16 void CommandThread::HandleInput(const std::string &input)
\r
18 std::string command=input;
\r
19 std::string argument="";
\r
20 if(input.find(" ")!=std::string::npos)
\r
22 command=input.substr(0,input.find(" "));
\r
23 argument=input.substr(command.size()+1);
\r
25 StringFunctions::UpperCase(command,command);
\r
29 HandleHelpCommand();
\r
31 else if(command=="QUIT")
\r
37 std::cout << "Unknown command. Type HELP for a list of available commands." << std::endl;
\r
42 void CommandThread::HandleQuit()
\r
47 void CommandThread::Run()
\r
52 m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"CommandThread::run thread started.");
\r
62 }while(m_running && !IsCancelled());
\r