size_t Len() const { return GetStringData()->nDataLength; }
/// string contains any characters?
bool IsEmpty() const { return Len() == 0; }
- /// reinitialize string (and free data!)
+ /// reinitialize string (and free memory)
void Empty()
{
- if ( GetStringData()->nDataLength != 0 )
+ if ( !IsEmpty() )
Reinit();
wxASSERT( GetStringData()->nDataLength == 0 );
//@{
/// take nLen chars starting at nPos
wxString(const wxString& str, size_t nPos, size_t nLen = npos)
- {
+ {
wxASSERT( str.GetStringData()->IsValid() );
InitWith(str.c_str(), nPos, nLen == npos ? 0 : nLen);
}
#ifdef STD_STRING_COMPATIBILITY
// fwd decl
-class WXDLLEXPORT istream;
+// Known not to work with wxUSE_IOSTREAMH set to 0, so
+// replacing with includes (on advice of ungod@pasdex.com.au)
+// class WXDLLEXPORT istream;
+#if wxUSE_IOSTREAMH
+#include <istream.h>
+#else
+#include <istream>
+# ifdef _MSC_VER
+ using namespace std;
+# endif
+#endif
istream& WXDLLEXPORT operator>>(istream& is, wxString& str);