diff --git a/String.cpp b/String.cpp index 062acf5b..ea267c58 100644 --- a/String.cpp +++ b/String.cpp @@ -175,9 +175,11 @@ CString CString::ToKBytes(double d) { return szRet; } -unsigned long long CString::ToULongLong() const { return( strtoull( c_str(), NULL, 10 ) ); } -long long CString::ToLongLong() const { return( strtoll( c_str(), NULL, 10 ) ); } -double CString::ToDouble() const { return( strtod( c_str(), NULL ) ); } +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); } +long long CString::ToLongLong() const { return strtoll(c_str(), NULL, 10); } +double CString::ToDouble() const { return strtod(c_str(), NULL); } bool CString::Trim(const CString& s) { diff --git a/String.h b/String.h index 26cffb9a..a8ba2112 100644 --- a/String.h +++ b/String.h @@ -47,7 +47,8 @@ public: static CString ToPercent(double d); static CString ToKBytes(double d); - + int ToInt() const; + unsigned int ToUInt() const; unsigned long long ToULongLong() const; long long ToLongLong() const; double ToDouble() const;