#ifndef COMMAND_THAT_LINE #define COMMAND_THAT_LINE 1 #include "common.h" #include #include #include #include "network.h" using namespace std; using namespace Network; class CommandLine; // type definition for callback functions typedef wxString (*cmdcallback) (CommandLine *cmdline, const wxString&); typedef struct { wxString sCommand; // the command wxString sHelp; // the help message cmdcallback function; // the function } cmdCallBackFunction; // vector with callbackfunctions typedef vector callbackVector; class CommandLine : public wxThread { public: CommandLine(TCP_socket psocket); ~CommandLine(); bool RegisterCmd(wxString (*func)(CommandLine *cmdline, const wxString&), const wxString& sCommand, const wxString& sHelp); wxThread::ExitCode Entry(); callbackVector functions; private: //wxString ReadLine(TCP_socket socket); cmdcallback MatchFunction( const wxString& sCommand , wxString& sArgs ); bool running; TCP_socket socket; }; #endif