Added static function Concat() for catting a suffix onto a nick

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@313 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-05-16 01:28:48 +00:00
parent 30c3bff700
commit e4a2c7aa8f
2 changed files with 9 additions and 0 deletions

View File

@@ -18,6 +18,14 @@ void CNick::Reset() {
m_cPerm = '\0';
}
CString CNick::Concat(const CString& sNick, const CString& sSuffix, unsigned int uMaxNickLen) {
if (sSuffix.length() >= uMaxNickLen) {
return sSuffix.Left(uMaxNickLen);
}
return sNick.Left(uMaxNickLen - sSuffix.length()) + sSuffix;
}
void CNick::Parse(const CString& sNickMask) {
if (sNickMask.empty()) {
return;

1
Nick.h
View File

@@ -23,6 +23,7 @@ public:
void Parse(const CString& sNickMask);
CString GetHostMask() const;
unsigned int GetCommonChans(vector<CChan*>& vChans, CUser* pUser) const;
static CString Concat(const CString& sNick, const CString& sSuffix, unsigned int uMaxNickLen = 9);
// Setters
void SetUser(CUser* pUser);