Added ToBool()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@409 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-07-05 09:21:16 +00:00
parent 653fe468f0
commit 30e98ba2bb
2 changed files with 3 additions and 1 deletions

View File

@@ -256,7 +256,7 @@ VCString CString::Split(const CString& sDelim, bool bAllowEmpty) const {
}
unsigned int CString::Split(const CString& sDelim, VCString& vsRet, bool bAllowEmpty) const {
vsRet.empty();
vsRet.clear();
CString sTmp = *this;
while (sTmp.size()) {
@@ -346,6 +346,7 @@ CString CString::ToKBytes(double d) {
return szRet;
}
bool CString::ToBool() const { return (!Trim_n().Trim_n("0").empty() && CaseCmp("false") != 0); }
short CString::ToShort() const { return strtoul(this->c_str(), (char**) NULL, 10); }
unsigned short CString::ToUShort() const { return strtoul(this->c_str(), (char**) NULL, 10); }
unsigned int CString::ToUInt() const { return strtoul(this->c_str(), (char**) NULL, 10); }