if(!m_input) return 0;
wxString word = ReadWord();
- if(word.IsEmpty())
+ if(word.empty())
return 0;
return wxStrtoul(word.c_str(), 0, base);
}
if(!m_input) return 0;
wxString word = ReadWord();
- if(word.IsEmpty())
+ if(word.empty())
return 0;
return wxStrtol(word.c_str(), 0, base);
}
{
if(!m_input) return 0;
wxString word = ReadWord();
- if(word.IsEmpty())
+ if(word.empty())
return 0;
return wxStrtod(word.c_str(), 0);
}
}
out << c;
- }
+ }
// We must not write the trailing NULL here
#if wxUSE_UNICODE
#endif
}
+wxTextOutputStream& wxTextOutputStream::PutChar(wxChar c)
+{
+#if wxUSE_UNICODE
+ WriteString( wxString(&c, m_conv, 1) );
+#else
+ WriteString( wxString(&c, wxConvLocal, 1) );
+#endif
+ return *this;
+}
+
wxTextOutputStream& wxTextOutputStream::operator<<(const wxChar *string)
{
WriteString( wxString(string) );
wxTextOutputStream &endl( wxTextOutputStream &stream )
{
- //RN: Normally a single char on builds without a real
- //wchar_t will call the version that corresponds to the
- //numeric value of wchar_t itself (wxUint16 if 2 bytes etc.),
- //which is not what we want (will print a 10 numeric value,
- //not a newline). Thus, we need to send it a string in that
- // case instead so that it correctly prints the newline.
-#if !wxUSE_UNICODE || wxWCHAR_T_IS_REAL_TYPE
- return stream << wxT('\n');
-#else
- return stream << wxT("\n");
-#endif
+ return stream.PutChar(wxT('\n'));
}
#endif