diff --git a/String.cpp b/String.cpp index a7788e8e..8e1ed675 100644 --- a/String.cpp +++ b/String.cpp @@ -192,6 +192,8 @@ CString CString::ToKBytes(double d) { return szRet; } +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); } int CString::ToInt() const { return strtoul(this->c_str(), (char**) NULL, 10); } unsigned long long CString::ToULongLong() const { return strtoull( c_str(), NULL, 10); } diff --git a/String.h b/String.h index cac726b1..85b8c080 100644 --- a/String.h +++ b/String.h @@ -49,6 +49,8 @@ public: static CString ToPercent(double d); static CString ToKBytes(double d); + short ToShort() const; + unsigned short ToUShort() const; int ToInt() const; unsigned int ToUInt() const; unsigned long long ToULongLong() const;