mirror of
https://github.com/znc/znc.git
synced 2026-08-06 17:03:14 +02:00
Moved CUtils::Ellipsize() into CString class
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@245 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+1
-1
@@ -743,7 +743,7 @@ void CUserSock::UserCommand(const CString& sLine) {
|
||||
for (unsigned int b = 0; b < Modules.size(); b++) {
|
||||
Table.AddRow();
|
||||
Table.SetCell("Name", Modules[b]->GetModName());
|
||||
Table.SetCell("Description", CUtils::Ellipsize(Modules[b]->GetDescription(), 128));
|
||||
Table.SetCell("Description", Modules[b]->GetDescription().Ellipsize(128));
|
||||
}
|
||||
|
||||
unsigned int uTableIdx = 0; CString sLine;
|
||||
|
||||
@@ -430,26 +430,6 @@ string& CUtils::RightChomp(string& s, unsigned int uLen) {
|
||||
return s;
|
||||
}
|
||||
|
||||
string CUtils::Ellipsize(const string& s, unsigned int uLen) {
|
||||
if (uLen >= s.size()) {
|
||||
return s;
|
||||
}
|
||||
|
||||
string sRet;
|
||||
|
||||
if (uLen < 4) {
|
||||
for (unsigned int a = 0; a < uLen; a++) {
|
||||
sRet += ".";
|
||||
}
|
||||
|
||||
return sRet;
|
||||
}
|
||||
|
||||
sRet = s.substr(0, uLen -3) + "...";
|
||||
|
||||
return sRet;
|
||||
}
|
||||
|
||||
bool CUtils::wildcmp(const string& sWild, const string& sString) {
|
||||
// Written by Jack Handy - jakkhandy@hotmail.com
|
||||
const char *wild = sWild.c_str(), *string = sString.c_str();
|
||||
|
||||
@@ -61,7 +61,6 @@ public:
|
||||
static string& Trim(string& s);
|
||||
static string& LeftChomp(string& s, unsigned int uLen = 1);
|
||||
static string& RightChomp(string& s, unsigned int uLen = 1);
|
||||
static string Ellipsize(const string& s, unsigned int uLen);
|
||||
static bool wildcmp(const string& sWild, const string& sString);
|
||||
|
||||
static unsigned long long GetMillTime() {
|
||||
|
||||
+5
-2
@@ -15,6 +15,9 @@
|
||||
* Author: imaginos <imaginos@imaginos.net>
|
||||
*
|
||||
* $Log$
|
||||
* Revision 1.5 2005/05/07 09:43:26 prozacx
|
||||
* Moved CUtils::Ellipsize() into CString class
|
||||
*
|
||||
* Revision 1.4 2005/05/05 18:11:04 prozacx
|
||||
* Changed all references to std::string over to CString
|
||||
*
|
||||
@@ -133,9 +136,9 @@ public:
|
||||
{
|
||||
//PutModule( "------------------- New Email -------------------" );
|
||||
Table.AddRow();
|
||||
Table.SetCell( "From", CUtils::Ellipsize( vEmails[a].sFrom, 32 ) );
|
||||
Table.SetCell( "From", vEmails[a].sFrom.Ellipsize( 32 ) );
|
||||
Table.SetCell( "Size", CUtils::ToString( vEmails[a].iSize ) );
|
||||
Table.SetCell( "Subject", CUtils::Ellipsize( vEmails[a].sSubject, 64 ) );
|
||||
Table.SetCell( "Subject", vEmails[a].sSubject.Ellipsize( 64 ) );
|
||||
}
|
||||
ssUidls.insert( vEmails[a].sUidl );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user