diff options
Diffstat (limited to 'core/fxcrt/widestring.cpp')
-rw-r--r-- | core/fxcrt/widestring.cpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/core/fxcrt/widestring.cpp b/core/fxcrt/widestring.cpp index e3c08d72e1..146de3af0c 100644 --- a/core/fxcrt/widestring.cpp +++ b/core/fxcrt/widestring.cpp @@ -1024,48 +1024,10 @@ void WideString::TrimRight(const WideStringView& targets) { } } -float FX_wtof(const wchar_t* str, int len) { - if (len == 0) { - return 0.0; - } - int cc = 0; - bool bNegative = false; - if (str[0] == '+') { - cc++; - } else if (str[0] == '-') { - bNegative = true; - cc++; - } - int integer = 0; - while (cc < len) { - if (str[cc] == '.') { - break; - } - integer = integer * 10 + FXSYS_DecimalCharToInt(str[cc]); - cc++; - } - float fraction = 0; - if (str[cc] == '.') { - cc++; - float scale = 0.1f; - while (cc < len) { - fraction += scale * FXSYS_DecimalCharToInt(str[cc]); - scale *= 0.1f; - cc++; - } - } - fraction += static_cast<float>(integer); - return bNegative ? -fraction : fraction; -} - int WideString::GetInteger() const { return m_pData ? FXSYS_wtoi(m_pData->m_String) : 0; } -float WideString::GetFloat() const { - return m_pData ? FX_wtof(m_pData->m_String, m_pData->m_nDataLength) : 0.0f; -} - std::wostream& operator<<(std::wostream& os, const WideString& str) { return os.write(str.c_str(), str.GetLength()); } |