Rename one of overloads of CMessage::GetParams to GetParamsColon

This commit is contained in:
Alexey Sokolov
2018-06-01 21:13:36 +01:00
parent 309eafa6f7
commit 5b7daac2f0
2 changed files with 18 additions and 3 deletions
+17 -2
View File
@@ -30,6 +30,14 @@
#define ZNC_LVREFQUAL
#endif
#ifdef SWIG
#define ZNC_MSG_DEPRECATED(msg, repl)
#elif defined(__clang__)
#define ZNC_MSG_DEPRECATED(msg, repl) __attribute__((deprecated(msg, repl)))
#else
#define ZNC_MSG_DEPRECATED(msg, repl) __attribute__((deprecated(msg)))
#endif
#include <znc/zncconfig.h>
#include <znc/ZNCString.h>
#include <znc/Nick.h>
@@ -55,7 +63,8 @@ class CIRCNetwork;
* - `nick` is the sender, which can be obtained with GetNick()
* - `cmd` is command, which is obtained via GetCommand()
* - `0`, `1`, ... are parameters, available via GetParam(n), which removes the
* leading colon (:). If you don't want to remove the colon, use GetParams().
* leading colon (:). If you don't want to remove the colon, use
* GetParamsColon().
*
* For certain events, like a PRIVMSG, convienience commands like GetChan() and
* GetNick() are available, this is not true for all CMessage extensions.
@@ -114,9 +123,15 @@ class CMessage {
void SetCommand(const CString& sCommand);
const VCString& GetParams() const { return m_vsParams; }
CString GetParams(unsigned int uIdx, unsigned int uLen = -1) const;
void SetParams(const VCString& vsParams);
/// @deprecated use GetParamsColon() instead.
CString GetParams(unsigned int uIdx, unsigned int uLen = -1) const
ZNC_MSG_DEPRECATED("Use GetParamsColon() instead", "GetParamsColon") {
return GetParamsColon(uIdx, uLen);
}
CString GetParamsColon(unsigned int uIdx, unsigned int uLen = -1) const;
CString GetParam(unsigned int uIdx) const;
void SetParam(unsigned int uIdx, const CString& sParam);
+1 -1
View File
@@ -48,7 +48,7 @@ void CMessage::SetCommand(const CString& sCommand) {
InitType();
}
CString CMessage::GetParams(unsigned int uIdx, unsigned int uLen) const {
CString CMessage::GetParamsColon(unsigned int uIdx, unsigned int uLen) const {
if (m_vsParams.empty() || uLen == 0) {
return "";
}