From: <Jef...@us...> - 2007-10-09 21:15:10
|
Revision: 252 http://libirc.svn.sourceforge.net/libirc/?rev=252&view=rev Author: JeffM2501 Date: 2007-10-09 14:15:06 -0700 (Tue, 09 Oct 2007) Log Message: ----------- rename all the client specific command handlers to say client, so we don't conflict with the server ones that will be happening soon. Modified Paths: -------------- trunk/libirc/include/IRCClient.h trunk/libirc/include/IRCEvents.h trunk/libirc/src/IRCClient.cpp trunk/libirc/src/irClientCommands.cpp trunk/libirc/src/irClientEvents.cpp trunk/libirc/src/ircBasicCommands.cpp trunk/libirc/src/ircBasicCommands.h Modified: trunk/libirc/include/IRCClient.h =================================================================== --- trunk/libirc/include/IRCClient.h 2007-10-09 20:44:09 UTC (rev 251) +++ trunk/libirc/include/IRCClient.h 2007-10-09 21:15:06 UTC (rev 252) @@ -169,6 +169,7 @@ //command handler methods... for lower level API virtual bool registerCommandHandler ( IRCClientCommandHandler *handler ); virtual bool removeCommandHandler ( IRCClientCommandHandler *handler ); + virtual int listUserHandledCommands ( std::vector<std::string> &commandList ); virtual int listDefaultHandledCommands ( std::vector<std::string> &commandList ); @@ -307,3 +308,11 @@ }; #endif //_IRC_CLIENT_H_ + +// Local Variables: *** +// mode:C++ *** +// tab-width: 8 *** +// c-basic-offset: 2 *** +// indent-tabs-mode: t *** +// End: *** +// ex: shiftwidth=2 tabstop=8 Modified: trunk/libirc/include/IRCEvents.h =================================================================== --- trunk/libirc/include/IRCEvents.h 2007-10-09 20:44:09 UTC (rev 251) +++ trunk/libirc/include/IRCEvents.h 2007-10-09 21:15:06 UTC (rev 252) @@ -134,3 +134,10 @@ typedef std::map<teIRCEventType,IRCBasicEventCallback*> tmIRCEventMap; #endif // __IRC_EVENTS_H__ +// Local Variables: *** +// mode: C++ *** +// tab-width: 8 *** +// c-basic-offset: 2 *** +// indent-tabs-mode: t *** +// End: *** +// ex: shiftwidth=2 tabstop=8 Modified: trunk/libirc/src/IRCClient.cpp =================================================================== --- trunk/libirc/src/IRCClient.cpp 2007-10-09 20:44:09 UTC (rev 251) +++ trunk/libirc/src/IRCClient.cpp 2007-10-09 21:15:06 UTC (rev 252) @@ -552,21 +552,21 @@ clearDefaultCommandHandlers(); // the "special" handlers - addDefaultCommandHandlers(new IRCALLCommand ); - addDefaultCommandHandlers(new IRCNumericCommand ); + addDefaultCommandHandlers(new IRCClientALLCommand ); + addDefaultCommandHandlers(new IRCClientNumericCommand ); // basic IRC commands - addDefaultCommandHandlers(new IRCNickCommand ); - addDefaultCommandHandlers(new IRCUserCommand ); - addDefaultCommandHandlers(new IRCPingCommand ); - addDefaultCommandHandlers(new IRCPongCommand ); - addDefaultCommandHandlers(new IRCNoticeCommand ); - addDefaultCommandHandlers(new IRCJoinCommand ); - addDefaultCommandHandlers(new IRCPartCommand ); - addDefaultCommandHandlers(new IRCQuitCommand ); - addDefaultCommandHandlers(new IRCModeCommand ); - addDefaultCommandHandlers(new IRCPrivMsgCommand ); - addDefaultCommandHandlers(new IRCKickCommand ); + addDefaultCommandHandlers(new IRCClientNickCommand ); + addDefaultCommandHandlers(new IRCClientUserCommand ); + addDefaultCommandHandlers(new IRCClientPingCommand ); + addDefaultCommandHandlers(new IRCClientPongCommand ); + addDefaultCommandHandlers(new IRCClientNoticeCommand ); + addDefaultCommandHandlers(new IRCClientJoinCommand ); + addDefaultCommandHandlers(new IRCClientPartCommand ); + addDefaultCommandHandlers(new IRCClientQuitCommand ); + addDefaultCommandHandlers(new IRCClientModeCommand ); + addDefaultCommandHandlers(new IRCClientPrivMsgCommand ); + addDefaultCommandHandlers(new IRCClientKickCommand ); } // logical event handlers Modified: trunk/libirc/src/irClientCommands.cpp =================================================================== --- trunk/libirc/src/irClientCommands.cpp 2007-10-09 20:44:09 UTC (rev 251) +++ trunk/libirc/src/irClientCommands.cpp 2007-10-09 21:15:06 UTC (rev 252) @@ -356,4 +356,11 @@ } +// Local Variables: *** +// mode: C++ *** +// tab-width: 8 *** +// c-basic-offset: 2 *** +// indent-tabs-mode: t *** +// End: *** +// ex: shiftwidth=2 tabstop=8 Modified: trunk/libirc/src/irClientEvents.cpp =================================================================== --- trunk/libirc/src/irClientEvents.cpp 2007-10-09 20:44:09 UTC (rev 251) +++ trunk/libirc/src/irClientEvents.cpp 2007-10-09 21:15:06 UTC (rev 252) @@ -284,3 +284,10 @@ +// Local Variables: *** +// mode: C++ *** +// tab-width: 8 *** +// c-basic-offset: 2 *** +// indent-tabs-mode: t *** +// End: *** +// ex: shiftwidth=2 tabstop=8 Modified: trunk/libirc/src/ircBasicCommands.cpp =================================================================== --- trunk/libirc/src/ircBasicCommands.cpp 2007-10-09 20:44:09 UTC (rev 251) +++ trunk/libirc/src/ircBasicCommands.cpp 2007-10-09 21:15:06 UTC (rev 252) @@ -20,18 +20,18 @@ // IRC "NICK" command -IRCNickCommand::IRCNickCommand() +IRCClientNickCommand::IRCClientNickCommand() { name = "NICK"; } -bool IRCNickCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientNickCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { client.nickCommand(info); return true; } -bool IRCNickCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientNickCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -46,17 +46,17 @@ // IRC "USER" command -IRCUserCommand::IRCUserCommand() +IRCClientUserCommand::IRCClientUserCommand() { name = "USER"; } -bool IRCUserCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientUserCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { return true; } -bool IRCUserCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientUserCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -70,12 +70,12 @@ } // IRC "PING" command -IRCPingCommand::IRCPingCommand() +IRCClientPingCommand::IRCClientPingCommand() { name = "PING"; } -bool IRCPingCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPingCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo ircInfo; ircInfo.command = eCMD_PONG; @@ -83,7 +83,7 @@ return true; } -bool IRCPingCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPingCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -94,18 +94,18 @@ } // IRC "PONG" command -IRCPongCommand::IRCPongCommand() +IRCClientPongCommand::IRCClientPongCommand() { name = "PONG"; } -bool IRCPongCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPongCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { // we do nothing on a pong return true; } -bool IRCPongCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPongCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -116,12 +116,12 @@ } // IRC "NOTICE" command -IRCNoticeCommand::IRCNoticeCommand() +IRCClientNoticeCommand::IRCClientNoticeCommand() { name = "NOTICE"; } -bool IRCNoticeCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientNoticeCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { trClientMessageEventInfo messageInfo; @@ -133,25 +133,25 @@ return true; } -bool IRCNoticeCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientNoticeCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { // we do nothing on a pong return true; } // IRC "JOIN" command -IRCJoinCommand::IRCJoinCommand() +IRCClientJoinCommand::IRCClientJoinCommand() { name = "JOIN"; } -bool IRCJoinCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientJoinCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { client.joinMessage(info); return true; } -bool IRCJoinCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientJoinCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { std::string commandLine; @@ -177,18 +177,18 @@ } // IRC "PART" command -IRCPartCommand::IRCPartCommand() +IRCClientPartCommand::IRCClientPartCommand() { name = "PART"; } -bool IRCPartCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPartCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { client.partMessage(info); return true; } -bool IRCPartCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPartCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { std::string commandLine; @@ -201,18 +201,18 @@ // IRC "QUIT" command -IRCQuitCommand::IRCQuitCommand() +IRCClientQuitCommand::IRCClientQuitCommand() { name = "QUIT"; } -bool IRCQuitCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientQuitCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { client.QuitMessage(info); return true; } -bool IRCQuitCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientQuitCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { std::string commandLine; @@ -225,19 +225,19 @@ } // IRC "MODE" command -IRCModeCommand::IRCModeCommand() +IRCClientModeCommand::IRCClientModeCommand() { name = "MODE"; } -bool IRCModeCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientModeCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { // we got a mode message, see what the deal is client.modeCommand(info); return true; } -bool IRCModeCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientModeCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { // MODE TARGET modes std::string modeline = info.target; @@ -254,18 +254,18 @@ } // IRC "PRIVMSG" command -IRCPrivMsgCommand::IRCPrivMsgCommand() +IRCClientPrivMsgCommand::IRCClientPrivMsgCommand() { name = "PRIVMSG"; } -bool IRCPrivMsgCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPrivMsgCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { client.privMessage(info); return true; } -bool IRCPrivMsgCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPrivMsgCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -279,18 +279,18 @@ // IRC "KICK" command -IRCKickCommand::IRCKickCommand() +IRCClientKickCommand::IRCClientKickCommand() { name = "KICK"; } -bool IRCKickCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientKickCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { client.kickCommand(info); return true; } -bool IRCKickCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientKickCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -306,12 +306,12 @@ // special case commands // Generic handler for ALL -IRCALLCommand::IRCALLCommand() +IRCClientALLCommand::IRCClientALLCommand() { name = "ALL"; } -bool IRCALLCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientALLCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { // just log it out client.log(string_util::format("ALL::command %s from %s for %s containing %s",info.command.c_str(),info.source.c_str(),info.target.c_str(),info.getAsString().c_str()),4); @@ -320,7 +320,7 @@ return true; } -bool IRCALLCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientALLCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { // just log it out client.log(string_util::format("ALL::command %s: to server containing %s",command.c_str(),info.getAsString().c_str()),4); @@ -329,12 +329,12 @@ // numerics -IRCNumericCommand::IRCNumericCommand() +IRCClientNumericCommand::IRCClientNumericCommand() { name = "NUMERIC"; } -bool IRCNumericCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientNumericCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) { int numeric = atoi(info.command.c_str()); @@ -572,5 +572,12 @@ return true; } +// Local Variables: *** +// mode: C++ *** +// tab-width: 8 *** +// c-basic-offset: 2 *** +// indent-tabs-mode: t *** +// End: *** +// ex: shiftwidth=2 tabstop=8 Modified: trunk/libirc/src/ircBasicCommands.h =================================================================== --- trunk/libirc/src/ircBasicCommands.h 2007-10-09 20:44:09 UTC (rev 251) +++ trunk/libirc/src/ircBasicCommands.h 2007-10-09 21:15:06 UTC (rev 252) @@ -19,19 +19,19 @@ // special case commands // handles ALL posible messages, dosn't actualy DO anythign with them tho -class IRCALLCommand : public IRCClientCommandHandler +class IRCClientALLCommand : public IRCClientCommandHandler { public: - IRCALLCommand(); + IRCClientALLCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // numerics, handles any IRC numeric return code -class IRCNumericCommand : public IRCClientCommandHandler +class IRCClientNumericCommand : public IRCClientCommandHandler { public: - IRCNumericCommand(); + IRCClientNumericCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; @@ -39,115 +39,120 @@ // IRC "NICK" command // paramaters {NICKNAME} -class IRCNickCommand : public IRCClientCommandHandler +class IRCClientNickCommand : public IRCClientCommandHandler { public: - IRCNickCommand(); + IRCClientNickCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // IRC "USER" command // paramaters {USERNAME, HOST, SERVER, REAL_NAME} -class IRCUserCommand : public IRCClientCommandHandler +class IRCClientUserCommand : public IRCClientCommandHandler { public: - IRCUserCommand(); + IRCClientUserCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // IRC "PING" command // paramaters {} -class IRCPingCommand : public IRCClientCommandHandler +class IRCClientPingCommand : public IRCClientCommandHandler { public: - IRCPingCommand(); + IRCClientPingCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // IRC "PONG" command // paramaters {} -class IRCPongCommand : public IRCClientCommandHandler +class IRCClientPongCommand : public IRCClientCommandHandler { public: - IRCPongCommand(); + IRCClientPongCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // IRC "NOTICE" command // paramaters {} -class IRCNoticeCommand : public IRCClientCommandHandler +class IRCClientNoticeCommand : public IRCClientCommandHandler { public: - IRCNoticeCommand(); + IRCClientNoticeCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // IRC "JOIN" command // paramaters {chanel1,chanel2......} -class IRCJoinCommand : public IRCClientCommandHandler +class IRCClientJoinCommand : public IRCClientCommandHandler { public: - IRCJoinCommand(); + IRCClientJoinCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // IRC "PART" command // paramaters {channel reason} -class IRCPartCommand : public IRCClientCommandHandler +class IRCClientPartCommand : public IRCClientCommandHandler { public: - IRCPartCommand(); + IRCClientPartCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // IRC "QUIT" command // paramaters {channel reason} -class IRCQuitCommand : public IRCClientCommandHandler +class IRCClientQuitCommand : public IRCClientCommandHandler { public: - IRCQuitCommand(); + IRCClientQuitCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // IRC "MODE" command // paramaters {target,modes} -class IRCModeCommand : public IRCClientCommandHandler +class IRCClientModeCommand : public IRCClientCommandHandler { public: - IRCModeCommand(); + IRCClientModeCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // IRC "PRIVMSG" command // paramaters -class IRCPrivMsgCommand : public IRCClientCommandHandler +class IRCClientPrivMsgCommand : public IRCClientCommandHandler { public: - IRCPrivMsgCommand(); + IRCClientPrivMsgCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; // IRC "KICK" command // paramaters {user,reason} -class IRCKickCommand : public IRCClientCommandHandler +class IRCClientKickCommand : public IRCClientCommandHandler { public: - IRCKickCommand(); + IRCClientKickCommand(); virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); }; +#endif //_IRC_BASIC_COMMANDS_ - - -#endif //_IRC_BASIC_COMMANDS_ +// Local Variables: *** +// mode: C++ *** +// tab-width: 8 *** +// c-basic-offset: 2 *** +// indent-tabs-mode: t *** +// End: *** +// ex: shiftwidth=2 tabstop=8 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |