From fd231e6b3adce748731a64d89c1efbc1c466e4a7 Mon Sep 17 00:00:00 2001 From: prozacx Date: Sun, 8 May 2005 06:42:02 +0000 Subject: [PATCH] Moved CUtils::ToString() into CString class git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@249 726aef4b-f618-498e-8847-2d620e286838 --- modules/away.cpp | 13 ++++++++----- modules/email.cpp | 5 ++++- modules/savebuff.cpp | 5 ++++- modules/schat.cpp | 13 ++++++++----- modules/watch.cpp | 14 +++++++------- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/modules/away.cpp b/modules/away.cpp index 76c8572d..2bb597f7 100644 --- a/modules/away.cpp +++ b/modules/away.cpp @@ -20,6 +20,9 @@ * * * $Log$ + * Revision 1.12 2005/05/08 06:42:01 prozacx + * Moved CUtils::ToString() into CString class + * * Revision 1.11 2005/05/08 04:30:13 prozacx * Moved CUtils::Trim() into CString class * @@ -205,7 +208,7 @@ public: CString sWhich = sCommand.Token(1); if ( sWhich == "all" ) { - PutModNotice( "Deleted " + CUtils::ToString( m_vMessages.size() ) + " Messages.", "away" ); + PutModNotice( "Deleted " + CString::ToString( m_vMessages.size() ) + " Messages.", "away" ); for( u_int a = 0; a < m_vMessages.size(); a++ ) m_vMessages.erase( m_vMessages.begin() + a-- ); @@ -273,7 +276,7 @@ public: m_vMessages.erase( m_vMessages.begin() + a-- ); continue; } - CString sTmp = " " + CUtils::ToString( a ) + ") ["; + CString sTmp = " " + CString::ToString( a ) + ") ["; sTmp.append( szFormat, iCount ); sTmp += "] "; sTmp += sMessage; @@ -335,12 +338,12 @@ public: if ( bUsePrivMessage ) { PutModule( "Welcome Back!", "away" ); - PutModule( "You have " + CUtils::ToString( m_vMessages.size() ) + " messages!", "away" ); + PutModule( "You have " + CString::ToString( m_vMessages.size() ) + " messages!", "away" ); } else { PutModNotice( "Welcome Back!", "away" ); - PutModNotice( "You have " + CUtils::ToString( m_vMessages.size() ) + " messages!", "away" ); + PutModNotice( "You have " + CString::ToString( m_vMessages.size() ) + " messages!", "away" ); } } m_sReason = ""; @@ -408,7 +411,7 @@ private: void AddMessage( time_t iTime, const CNick & Nick, CString & sMessage ) { - AddMessage( CUtils::ToString( iTime ) + ":" + Nick.GetNickMask() + ":" + sMessage ); + AddMessage( CString::ToString( iTime ) + ":" + Nick.GetNickMask() + ":" + sMessage ); } void AddMessage( const CString & sText ) diff --git a/modules/email.cpp b/modules/email.cpp index 3a1f1c2e..c4579e1c 100644 --- a/modules/email.cpp +++ b/modules/email.cpp @@ -15,6 +15,9 @@ * Author: imaginos * * $Log$ + * Revision 1.7 2005/05/08 06:42:02 prozacx + * Moved CUtils::ToString() into CString class + * * Revision 1.6 2005/05/08 04:30:14 prozacx * Moved CUtils::Trim() into CString class * @@ -140,7 +143,7 @@ public: //PutModule( "------------------- New Email -------------------" ); Table.AddRow(); Table.SetCell( "From", vEmails[a].sFrom.Ellipsize( 32 ) ); - Table.SetCell( "Size", CUtils::ToString( vEmails[a].iSize ) ); + Table.SetCell( "Size", CString::ToString( vEmails[a].iSize ) ); Table.SetCell( "Subject", vEmails[a].sSubject.Ellipsize( 64 ) ); } ssUidls.insert( vEmails[a].sUidl ); diff --git a/modules/savebuff.cpp b/modules/savebuff.cpp index e3b22127..0d7d5d05 100644 --- a/modules/savebuff.cpp +++ b/modules/savebuff.cpp @@ -26,6 +26,9 @@ * better solution then plain text. * * $Log$ + * Revision 1.21 2005/05/08 06:42:02 prozacx + * Moved CUtils::ToString() into CString class + * * Revision 1.20 2005/05/08 04:30:14 prozacx * Moved CUtils::Trim() into CString class * @@ -302,7 +305,7 @@ public: CString SpoofChanMsg( const CString & sChannel, const CString & sMesg ) { - CString sReturn = ":*" + GetModName() + "!znc@znc.com PRIVMSG " + sChannel + " :" + CUtils::ToString( time( NULL ) ) + " " + sMesg; + CString sReturn = ":*" + GetModName() + "!znc@znc.com PRIVMSG " + sChannel + " :" + CString::ToString( time( NULL ) ) + " " + sMesg; return( sReturn ); } diff --git a/modules/schat.cpp b/modules/schat.cpp index 17348952..87b0fa86 100644 --- a/modules/schat.cpp +++ b/modules/schat.cpp @@ -16,6 +16,9 @@ * Author: imaginos * * $Log$ + * Revision 1.12 2005/05/08 06:42:02 prozacx + * Moved CUtils::ToString() into CString class + * * Revision 1.11 2005/05/08 04:30:14 prozacx * Moved CUtils::Trim() into CString class * @@ -311,7 +314,7 @@ public: { Table.SetCell( "Status", "Established" ); Table.SetCell( "Host", pSock->GetRemoteIP() ); - Table.SetCell( "Port", CUtils::ToString( pSock->GetRemotePort() ) ); + Table.SetCell( "Port", CString::ToString( pSock->GetRemotePort() ) ); SSL_SESSION *pSession = pSock->GetSSLSession(); if ( ( pSession ) && ( pSession->cipher ) && ( pSession->cipher->name ) ) Table.SetCell( "Cipher", pSession->cipher->name ); @@ -319,7 +322,7 @@ public: } else { Table.SetCell( "Status", "Waiting" ); - Table.SetCell( "Port", CUtils::ToString( pSock->GetLocalPort() ) ); + Table.SetCell( "Port", CString::ToString( pSock->GetLocalPort() ) ); } } if ( Table.size() ) @@ -381,8 +384,8 @@ public: Table.SetCell( "Type", "Outbound" ); else Table.SetCell( "Type", "Inbound" ); - Table.SetCell( "LocalIP:Port", pSock->GetLocalIP() + ":" + CUtils::ToString( pSock->GetLocalPort() ) ); - Table.SetCell( "RemoteIP:Port", pSock->GetRemoteIP() + ":" + CUtils::ToString( pSock->GetRemotePort() ) ); + Table.SetCell( "LocalIP:Port", pSock->GetLocalIP() + ":" + CString::ToString( pSock->GetLocalPort() ) ); + Table.SetCell( "RemoteIP:Port", pSock->GetRemoteIP() + ":" + CString::ToString( pSock->GetRemotePort() ) ); SSL_SESSION *pSession = pSock->GetSSLSession(); if ( ( pSession ) && ( pSession->cipher ) && ( pSession->cipher->name ) ) Table.SetCell( "Cipher", pSession->cipher->name ); @@ -392,7 +395,7 @@ public: } else { Table.SetCell( "Type", "Listener" ); - Table.SetCell( "LocalIP:Port", pSock->GetLocalIP() + ":" + CUtils::ToString( pSock->GetLocalPort() ) ); + Table.SetCell( "LocalIP:Port", pSock->GetLocalIP() + ":" + CString::ToString( pSock->GetLocalPort() ) ); Table.SetCell( "RemoteIP:Port", "0.0.0.0:0" ); } } diff --git a/modules/watch.cpp b/modules/watch.cpp index 6c77f940..82130112 100644 --- a/modules/watch.cpp +++ b/modules/watch.cpp @@ -279,7 +279,7 @@ public: m_Buffer.SetLineCount(atoi(sCount.c_str())); } - PutModule("Buffer count is set to [" + CUtils::ToString(m_Buffer.GetLineCount()) + "]"); + PutModule("Buffer count is set to [" + CString::ToString(m_Buffer.GetLineCount()) + "]"); } else if (strcasecmp(sCmdName.c_str(), "DEL") == 0) { Remove(atoi(sCommand.Token(1).c_str())); } else { @@ -322,7 +322,7 @@ private: for (unsigned int a = 0; a < uIdx; a++, it++); (*it).SetDisabled(bDisabled); - PutModule("Id " + CUtils::ToString(uIdx +1) + ((bDisabled) ? " Disabled" : " Enabled")); + PutModule("Id " + CString::ToString(uIdx +1) + ((bDisabled) ? " Disabled" : " Enabled")); } void List() { @@ -340,7 +340,7 @@ private: CWatchEntry& WatchEntry = *it; Table.AddRow(); - Table.SetCell("Id", CUtils::ToString(uIdx)); + Table.SetCell("Id", CString::ToString(uIdx)); Table.SetCell("HostMask", WatchEntry.GetHostMask()); Table.SetCell("Target", WatchEntry.GetTarget()); Table.SetCell("Pattern", WatchEntry.GetPattern()); @@ -377,11 +377,11 @@ private: PutModule("/msg " + GetModNick() + " ADD " + WatchEntry.GetHostMask() + " " + WatchEntry.GetTarget() + " " + WatchEntry.GetPattern()); if (WatchEntry.GetSourcesStr().size()) { - PutModule("/msg " + GetModNick() + " SETSOURCES " + CUtils::ToString(uIdx) + " " + WatchEntry.GetSourcesStr()); + PutModule("/msg " + GetModNick() + " SETSOURCES " + CString::ToString(uIdx) + " " + WatchEntry.GetSourcesStr()); } if (WatchEntry.IsDisabled()) { - PutModule("/msg " + GetModNick() + " DISABLE " + CUtils::ToString(uIdx)); + PutModule("/msg " + GetModNick() + " DISABLE " + CString::ToString(uIdx)); } } @@ -399,7 +399,7 @@ private: for (unsigned int a = 0; a < uIdx; a++, it++); (*it).SetSources(sSources); - PutModule("Sources set for Id " + CUtils::ToString(uIdx +1) + "."); + PutModule("Sources set for Id " + CString::ToString(uIdx +1) + "."); } void Remove(unsigned int uIdx) { @@ -413,7 +413,7 @@ private: for (unsigned int a = 0; a < uIdx; a++, it++); m_lsWatchers.erase(it); - PutModule("Id " + CUtils::ToString(uIdx +1) + " Removed."); + PutModule("Id " + CString::ToString(uIdx +1) + " Removed."); } void Help() {