From: <Jef...@us...> - 2007-10-09 22:03:58
|
Revision: 254 http://libirc.svn.sourceforge.net/libirc/?rev=254&view=rev Author: JeffM2501 Date: 2007-10-09 15:03:54 -0700 (Tue, 09 Oct 2007) Log Message: ----------- keep the things that are const, const Modified Paths: -------------- trunk/libirc/include/IRCClient.h trunk/libirc/src/IRCClient.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 21:15:30 UTC (rev 253) +++ trunk/libirc/include/IRCClient.h 2007-10-09 22:03:54 UTC (rev 254) @@ -67,10 +67,10 @@ // it is recomended that the default ALWAYS be called, as it often sets internal data for other mesages // called when the client receves a command of this type - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ){return true;} + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ){return true;} // called when the user wishes to send a command of this type - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ){return true;} + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ){return true;} protected: std::string name; }; @@ -178,7 +178,7 @@ virtual bool sendIRCCommand ( teIRCCommands command, IRCCommandInfo &info ); virtual bool sendCTMPCommand ( teCTCPCommands command, CTCPCommandINfo &info ); - virtual bool receveCommand ( std::string &commandName, BaseIRCCommandInfo &info ); + virtual bool receveCommand ( const std::string &commandName, BaseIRCCommandInfo &info ); virtual bool receveIRCCommand ( teIRCCommands command, IRCCommandInfo &info ); virtual bool receveCTMPCommand ( teCTCPCommands command, CTCPCommandINfo &info ); Modified: trunk/libirc/src/IRCClient.cpp =================================================================== --- trunk/libirc/src/IRCClient.cpp 2007-10-09 21:15:30 UTC (rev 253) +++ trunk/libirc/src/IRCClient.cpp 2007-10-09 22:03:54 UTC (rev 254) @@ -245,14 +245,10 @@ commandInfo.source = getServerHost(); // call the "ALL" handler special if there is one - handler = std::string("ALL"); - receveCommand(handler,commandInfo); + receveCommand(std::string("ALL"),commandInfo); if (atoi(commandInfo.command.c_str()) != 0) - { - handler = std::string("NUMERIC"); - receveCommand(handler,commandInfo); - } + receveCommand(std::string("NUMERIC"),commandInfo); // notify any handlers for this specific command receveCommand(commandInfo.command,commandInfo); @@ -406,7 +402,7 @@ return sendCommand(info.command,info); } -bool IRCClient::receveCommand ( std::string &commandName, BaseIRCCommandInfo &info ) +bool IRCClient::receveCommand ( const std::string &commandName, BaseIRCCommandInfo &info ) { tmUserCommandHandlersMap::iterator commandListItr = userCommandHandlers.find(commandName); Modified: trunk/libirc/src/ircBasicCommands.cpp =================================================================== --- trunk/libirc/src/ircBasicCommands.cpp 2007-10-09 21:15:30 UTC (rev 253) +++ trunk/libirc/src/ircBasicCommands.cpp 2007-10-09 22:03:54 UTC (rev 254) @@ -25,13 +25,13 @@ name = "NICK"; } -bool IRCClientNickCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientNickCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { client.nickCommand(info); return true; } -bool IRCClientNickCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientNickCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -51,12 +51,12 @@ name = "USER"; } -bool IRCClientUserCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientUserCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { return true; } -bool IRCClientUserCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientUserCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -75,7 +75,7 @@ name = "PING"; } -bool IRCClientPingCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPingCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo ircInfo; ircInfo.command = eCMD_PONG; @@ -83,7 +83,7 @@ return true; } -bool IRCClientPingCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPingCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -99,13 +99,13 @@ name = "PONG"; } -bool IRCClientPongCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPongCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { // we do nothing on a pong return true; } -bool IRCClientPongCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPongCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -121,7 +121,7 @@ name = "NOTICE"; } -bool IRCClientNoticeCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientNoticeCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { trClientMessageEventInfo messageInfo; @@ -133,7 +133,7 @@ return true; } -bool IRCClientNoticeCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientNoticeCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { // we do nothing on a pong return true; @@ -145,13 +145,13 @@ name = "JOIN"; } -bool IRCClientJoinCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientJoinCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { client.joinMessage(info); return true; } -bool IRCClientJoinCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientJoinCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { std::string commandLine; @@ -182,13 +182,13 @@ name = "PART"; } -bool IRCClientPartCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPartCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { client.partMessage(info); return true; } -bool IRCClientPartCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPartCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { std::string commandLine; @@ -206,13 +206,13 @@ name = "QUIT"; } -bool IRCClientQuitCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientQuitCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { client.QuitMessage(info); return true; } -bool IRCClientQuitCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientQuitCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { std::string commandLine; @@ -230,14 +230,14 @@ name = "MODE"; } -bool IRCClientModeCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientModeCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { // we got a mode message, see what the deal is client.modeCommand(info); return true; } -bool IRCClientModeCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientModeCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { // MODE TARGET modes std::string modeline = info.target; @@ -259,13 +259,13 @@ name = "PRIVMSG"; } -bool IRCClientPrivMsgCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPrivMsgCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { client.privMessage(info); return true; } -bool IRCClientPrivMsgCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientPrivMsgCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -284,13 +284,13 @@ name = "KICK"; } -bool IRCClientKickCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientKickCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { client.kickCommand(info); return true; } -bool IRCClientKickCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientKickCommand::send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { IRCCommandInfo &ircInfo = (IRCCommandInfo&)info; @@ -311,7 +311,7 @@ name = "ALL"; } -bool IRCClientALLCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientALLCommand::receve ( IRCClient &client, const 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 IRCClientALLCommand::send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientALLCommand::send ( IRCClient &client, const 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); @@ -334,7 +334,7 @@ name = "NUMERIC"; } -bool IRCClientNumericCommand::receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ) +bool IRCClientNumericCommand::receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ) { int numeric = atoi(info.command.c_str()); Modified: trunk/libirc/src/ircBasicCommands.h =================================================================== --- trunk/libirc/src/ircBasicCommands.h 2007-10-09 21:15:30 UTC (rev 253) +++ trunk/libirc/src/ircBasicCommands.h 2007-10-09 22:03:54 UTC (rev 254) @@ -23,8 +23,8 @@ { public: IRCClientALLCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // numerics, handles any IRC numeric return code @@ -32,7 +32,7 @@ { public: IRCClientNumericCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // Text based IRC commands @@ -43,8 +43,8 @@ { public: IRCClientNickCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // IRC "USER" command @@ -53,8 +53,8 @@ { public: IRCClientUserCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // IRC "PING" command @@ -63,8 +63,8 @@ { public: IRCClientPingCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // IRC "PONG" command @@ -73,8 +73,8 @@ { public: IRCClientPongCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // IRC "NOTICE" command @@ -83,8 +83,8 @@ { public: IRCClientNoticeCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // IRC "JOIN" command @@ -93,8 +93,8 @@ { public: IRCClientJoinCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // IRC "PART" command @@ -103,8 +103,8 @@ { public: IRCClientPartCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // IRC "QUIT" command @@ -113,8 +113,8 @@ { public: IRCClientQuitCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // IRC "MODE" command @@ -123,8 +123,8 @@ { public: IRCClientModeCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // IRC "PRIVMSG" command @@ -133,8 +133,8 @@ { public: IRCClientPrivMsgCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; // IRC "KICK" command @@ -143,8 +143,8 @@ { public: IRCClientKickCommand(); - virtual bool receve ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); - virtual bool send ( IRCClient &client, std::string &command, BaseIRCCommandInfo &info ); + virtual bool receve ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); + virtual bool send ( IRCClient &client, const std::string &command, BaseIRCCommandInfo &info ); }; #endif //_IRC_BASIC_COMMANDS_ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |