mirror of
https://github.com/znc/znc.git
synced 2026-08-08 01:43:03 +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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user