friend bool WXDLLEXPORT operator == (const wxDate &dt1, const wxDate &dt2);
friend bool WXDLLEXPORT operator != (const wxDate &dt1, const wxDate &dt2);
+#if wxUSE_STD_IOSTREAM
friend ostream WXDLLEXPORT & operator << (ostream &os, const wxDate &dt);
+#endif
wxString FormatDate (int type=-1) const;
void SetFormat (int format);
#include <iostream>
#endif
-#else
-
-#define NO_TEXT_WINDOW_STREAM
-
#endif
//-----------------------------------------------------------------------------
// wxTextCtrl
//-----------------------------------------------------------------------------
-#ifndef NO_TEXT_WINDOW_STREAM
+#if wxUSE_STD_IOSTREAM
class wxTextCtrl: public wxControl, public streambuf
#else
class wxTextCtrl: public wxControl
void OnUpdateUndo(wxUpdateUIEvent& event);
void OnUpdateRedo(wxUpdateUIEvent& event);
-#ifndef NO_TEXT_WINDOW_STREAM
+#if wxUSE_STD_IOSTREAM
int overflow(int i);
int sync();
int underflow();
+#endif
wxTextCtrl& operator<<(const wxString& s);
wxTextCtrl& operator<<(int i);
wxTextCtrl& operator<<(float f);
wxTextCtrl& operator<<(double d);
wxTextCtrl& operator<<(const char c);
-#endif
bool SetFont( const wxFont &font );
bool SetForegroundColour(const wxColour &colour);
#include <iostream>
#endif
-#else
-
-#define NO_TEXT_WINDOW_STREAM
-
#endif
//-----------------------------------------------------------------------------
// wxTextCtrl
//-----------------------------------------------------------------------------
-#ifndef NO_TEXT_WINDOW_STREAM
+#if wxUSE_STD_IOSTREAM
class wxTextCtrl: public wxControl, public streambuf
#else
class wxTextCtrl: public wxControl
void OnUpdateUndo(wxUpdateUIEvent& event);
void OnUpdateRedo(wxUpdateUIEvent& event);
-#ifndef NO_TEXT_WINDOW_STREAM
+#if wxUSE_STD_IOSTREAM
int overflow(int i);
int sync();
int underflow();
+#endif
wxTextCtrl& operator<<(const wxString& s);
wxTextCtrl& operator<<(int i);
wxTextCtrl& operator<<(float f);
wxTextCtrl& operator<<(double d);
wxTextCtrl& operator<<(const char c);
-#endif
bool SetFont( const wxFont &font );
bool SetForegroundColour(const wxColour &colour);
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
+#if wxUSE_STD_IOSTREAM
+
#if wxUSE_IOSTREAMH
// N.B. BC++ doesn't have istream.h, ostream.h
# include <iostream.h>
using namespace std;
# endif
#endif
+
+#endif
+ // wxUSE_STD_IOSTREAM
\ No newline at end of file
#pragma interface "log.h"
#endif
+#include "wx/setup.h"
+
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
#define wxTraceOleCalls 0x0100 // OLE interface calls
#endif
-#if wxUSE_IOSTREAMH
-// N.B. BC++ doesn't have istream.h, ostream.h
-# include <iostream.h>
-#else
-# include <ostream>
-# if defined(__VISUALC__) || defined(__MWERKS__)
- using namespace std;
-# endif
-#endif
+#include "wx/ioswrap.h"
// ----------------------------------------------------------------------------
// derive from this class to redirect (or suppress, or ...) log messages
class WXDLLEXPORT wxHashTable;
class WXDLLEXPORT wxObject_Serialize;
-#if wxUSE_IOSTREAMH
- // N.B. BC++ doesn't have istream.h, ostream.h
-# include <iostream.h>
-#else
-# include <ostream>
-# if defined(__VISUALC__) || defined(__MWERKS__)
- using namespace std;
-# endif
+#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT)
+ #include "wx/ioswrap.h"
#endif
/*
#endif // Debug & memory tracing
-#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
+#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT)
virtual void Dump(ostream& str);
#endif
wxInputStream& operator>>(wxOutputStream& out) { return Read(out); }
wxInputStream& operator>>(wxString& line);
wxInputStream& operator>>(char& c);
- wxInputStream& operator>>(short& i);
- wxInputStream& operator>>(int& i);
- wxInputStream& operator>>(long& i);
+ wxInputStream& operator>>(signed short& i);
+ wxInputStream& operator>>(signed int& i);
+ wxInputStream& operator>>(signed long& i);
+ wxInputStream& operator>>(unsigned char& c);
+ wxInputStream& operator>>(unsigned short& i);
+ wxInputStream& operator>>(unsigned int& i);
+ wxInputStream& operator>>(unsigned long& i);
wxInputStream& operator>>(double& i);
+ wxInputStream& operator>>(float& f) { double d; operator>>((double&)d); f = (float)d; return *this; }
#if wxUSE_SERIAL
wxInputStream& operator>>(wxObject *& obj);
#endif
-
- wxInputStream& operator>>(float& f) { double d; operator>>((double&)d); f = (float)d; return *this; }
- wxInputStream& operator>>(unsigned char& c) { return operator>>((char&)c); }
- wxInputStream& operator>>(unsigned short& i) { return operator>>((short&)i); }
- wxInputStream& operator>>(unsigned int& i) { return operator>>((int&)i); }
- wxInputStream& operator>>(unsigned long& i) { return operator>>((long&)i); }
wxInputStream& operator>>( __wxInputManip func) { return func(*this); }
protected:
wxOutputStream& operator<<(const char *string);
wxOutputStream& operator<<(wxString& string);
wxOutputStream& operator<<(char c);
- wxOutputStream& operator<<(short i);
- wxOutputStream& operator<<(int i);
- wxOutputStream& operator<<(long i);
+ wxOutputStream& operator<<(signed short i);
+ wxOutputStream& operator<<(signed int i);
+ wxOutputStream& operator<<(signed long i);
+ wxOutputStream& operator<<(unsigned char c);
+ wxOutputStream& operator<<(unsigned short i);
+ wxOutputStream& operator<<(unsigned int i);
+ wxOutputStream& operator<<(unsigned long i);
wxOutputStream& operator<<(double f);
+ wxOutputStream& operator<<(float f) { return operator<<((double)f); }
#if wxUSE_SERIAL
wxOutputStream& operator<<(wxObject& obj);
#endif
-
- wxOutputStream& operator<<(float f) { return operator<<((double)f); }
- wxOutputStream& operator<<(unsigned char c) { return operator<<((char)c); }
- wxOutputStream& operator<<(unsigned short i) { return operator<<((short)i); }
- wxOutputStream& operator<<(unsigned int i) { return operator<<((int)i); }
- wxOutputStream& operator<<(unsigned long i) { return operator<<((long)i); }
wxOutputStream& operator<<( __wxOutputManip func) { return func(*this); }
protected:
// Implementation only from here until the end of file
// ---------------------------------------------------------------------------
-#ifdef wxSTD_STRING_COMPATIBILITY
+#if defined(wxSTD_STRING_COMPATIBILITY) && wxUSE_STD_IOSTREAM
#include "wx/ioswrap.h"
#include "wx/window.h"
#include "wx/filefn.h"
-#include "wx/ioswrap.h"
-
#ifdef __X__
#include <dirent.h>
#include <unistd.h>
// Copy to data
virtual void Copy(wxVariantData& data) = 0;
virtual bool Eq(wxVariantData& data) const = 0;
+#if wxUSE_STD_IOSTREAM
virtual bool Write(ostream& str) const = 0;
+#endif
virtual bool Write(wxString& str) const = 0;
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str) = 0;
+#endif
virtual bool Read(wxString& str) = 0;
// What type is it? Return a string name.
virtual wxString GetType() const = 0;
#include "mondrian.xpm"
#endif
+#include "wx/ioswrap.h"
+
+#if wxUSE_IOSTREAMH
+ #include <fstream.h>
+#else
+ #include <fstream>
+#endif
+
+#include "wx/wfstream.h"
+
+
// Create a new application object
IMPLEMENT_APP (MyApp)
#if wxUSE_UNICODE
EVT_MENU(TYPES_UNICODE, MyApp::DoUnicodeDemo)
#endif
+ EVT_MENU(TYPES_STREAM, MyApp::DoStreamDemo)
END_EVENT_TABLE()
bool MyApp::OnInit(void)
#if wxUSE_UNICODE
file_menu->Append(TYPES_UNICODE, "&Unicode test");
#endif
+ file_menu->Append(TYPES_STREAM, "&Stream test");
file_menu->AppendSeparator();
file_menu->Append(TYPES_QUIT, "E&xit");
wxMenuBar *menu_bar = new wxMenuBar;
return TRUE;
}
+void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
+{
+ wxTextCtrl& textCtrl = * GetTextCtrl();
+
+ textCtrl.Clear();
+ textCtrl << "\nTest fstream vs. wxFileStream:\n\n";
+
+ ofstream std_file_output( "test_std.dat" );
+ wxFileOutputStream file_output( "test_wx.dat" );
+
+ textCtrl.WriteText( "Writig to fstream:\n" );
+
+ wxString tmp;
+ signed int si = 0xFFFFFFFF;
+ tmp.Printf( "Signed int: %d\n", si );
+ textCtrl.WriteText( tmp );
+ file_output << si << "\n";
+ std_file_output << si << "\n";
+
+ unsigned int ui = 0xFFFFFFFF;
+ tmp.Printf( "Unsigned int: %u\n", ui );
+ textCtrl.WriteText( tmp );
+ file_output << ui << "\n";
+ std_file_output << ui << "\n";
+
+ double d = 2.01234567890123456789;
+ tmp.Printf( "Double: %f\n", d );
+ textCtrl.WriteText( tmp );
+ file_output << d << "\n";
+ std_file_output << d << "\n";
+
+ wxString str( "Hello!" );
+ tmp.Printf( "String: %s\n", str.c_str() );
+ textCtrl.WriteText( tmp );
+ file_output << str << "\n";
+ std_file_output << str.c_str() << "\n";
+
+}
+
#if wxUSE_UNICODE
void MyApp::DoUnicodeDemo(wxCommandEvent& WXUNUSED(event))
{
void DoTimeDemo(wxCommandEvent& event);
void DoVariantDemo(wxCommandEvent& event);
void DoByteOrderDemo(wxCommandEvent& event);
+ void DoStreamDemo(wxCommandEvent& event);
#if wxUSE_UNICODE
void DoUnicodeDemo(wxCommandEvent& event);
#endif
#define TYPES_VARIANT 105
#define TYPES_BYTEORDER 106
#define TYPES_UNICODE 107
+#define TYPES_STREAM 108
#endif
// _WX_TYPETEST_H_
#if wxUSE_TIMEDATE
#include "wx/date.h"
-#include <wx/intl.h>
+#include "wx/intl.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#if wxUSE_IOSTREAMH
-#include <iostream.h>
-#else
-#include <iostream>
-#endif
+#include "wx/ioswrap.h"
#include <time.h>
#include <string.h>
return ( dt1.julian != dt2.julian );
}
+
+#if wxUSE_STD_IOSTREAM
+
////////////////////////////////////////////////////////////////
// Ostream operations
////////////////////////////////////////////////////////////////
return os << dt.FormatDate().mb_str();
}
+#endif
+
//////////////////////////////////////////////////////////////
// Conversion routines
//////////////////////////////////////////////////////////////
wxASSERT(object_dest.GetClassInfo()->IsKindOf(GetClassInfo()));
}
-#if defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT
+#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT)
void wxObject::Dump(ostream& str)
{
if (GetClassInfo() && GetClassInfo()->GetClassName())
return *this;
}
-wxInputStream& wxInputStream::operator>>(short& i)
+wxInputStream& wxInputStream::operator>>(signed short& i)
{
- long l;
+ signed long l;
*this >> l;
- i = (short)l;
+ i = (signed short)l;
return *this;
}
-wxInputStream& wxInputStream::operator>>(int& i)
+wxInputStream& wxInputStream::operator>>(signed int& i)
{
- long l;
+ signed long l;
*this >> l;
- i = (short)l;
+ i = (signed int)l;
return *this;
}
-wxInputStream& wxInputStream::operator>>(long& i)
+wxInputStream& wxInputStream::operator>>(signed long& i)
{
/* I only implemented a simple integer parser */
- int c, sign;
+ char c;
+ int sign;
while (isspace( c = GetC() ) )
/* Do nothing */ ;
return *this;
}
+wxInputStream& wxInputStream::operator>>(unsigned short& i)
+{
+ unsigned long l;
+
+ *this >> l;
+ i = (unsigned short)l;
+ return *this;
+}
+
+wxInputStream& wxInputStream::operator>>(unsigned int& i)
+{
+ unsigned long l;
+
+ *this >> l;
+ i = (unsigned int)l;
+ return *this;
+}
+
+wxInputStream& wxInputStream::operator>>(unsigned long& i)
+{
+ /* I only implemented a simple integer parser */
+ char c;
+
+ while (isspace( c = GetC() ) )
+ /* Do nothing */ ;
+
+ i = 0;
+ if (!isdigit(c)) {
+ InputStreamBuffer()->WriteBack(c);
+ return *this;
+ }
+
+ while (isdigit(c)) {
+ i = i*10 + c;
+ c = GetC();
+ }
+
+ return *this;
+}
+
wxInputStream& wxInputStream::operator>>(double& f)
{
/* I only implemented a simple float parser */
return Write(&c, 1);
}
-wxOutputStream& wxOutputStream::operator<<(short i)
+wxOutputStream& wxOutputStream::operator<<(signed short i)
{
- wxString strint;
+ signed long l = (signed long)i;
+ return *this << l;
+}
- strint.Printf(_T("%i"), i);
- return *this << strint;
+wxOutputStream& wxOutputStream::operator<<(signed int i)
+{
+ signed long l = (signed long)i;
+ return *this << l;
+}
+
+wxOutputStream& wxOutputStream::operator<<(signed long i)
+{
+ wxString strlong;
+ strlong.Printf(_T("%ld"), i);
+ return *this << strlong;
}
-wxOutputStream& wxOutputStream::operator<<(int i)
+wxOutputStream& wxOutputStream::operator<<(unsigned short i)
{
- wxString strint;
+ unsigned long l = (unsigned long)i;
+ return *this << l;
+}
- strint.Printf(_T("%i"), i);
- return *this << strint;
+wxOutputStream& wxOutputStream::operator<<(unsigned int i)
+{
+ unsigned long l = (unsigned long)i;
+ return *this << l;
}
-wxOutputStream& wxOutputStream::operator<<(long i)
+wxOutputStream& wxOutputStream::operator<<(unsigned long i)
{
wxString strlong;
-
- strlong.Printf(_T("%i"), i);
+ strlong.Printf(_T("%lu"), i);
return *this << strlong;
}
#include "wx/ioswrap.h"
-#if wxUSE_IOSTREAMH
+#if wxUSE_IOSTREAMH && wxUSE_STD_IOSTREAM
#include <iomanip.h>
#else
#include <iomanip>
#include "wx/textdlg.h"
#endif
-#include "wx/ioswrap.h"
-
-#if wxUSE_IOSTREAMH
- #include <fstream.h>
-#else
- #include <fstream>
-#endif
-
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#pragma hdrstop
#endif
-#if wxUSE_IOSTREAMH
+#if wxUSE_IOSTREAMH && wxUSE_STD_IOSTREAM
# include <fstream.h>
#else
# include <fstream>
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Write(ostream& str) const;
+#endif
virtual bool Write(wxString& str) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str);
+#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return _T("list"); };
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataList::Write(ostream& str) const
{
wxString s;
str << (const char*) s.mb_str();
return TRUE;
}
+#endif
bool wxVariantDataList::Write(wxString& str) const
{
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataList::Read(istream& WXUNUSED(str))
{
wxFAIL_MSG(_T("Unimplemented"));
// TODO
return FALSE;
}
+#endif
bool wxVariantDataList::Read(wxString& WXUNUSED(str))
{
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Write(ostream& str) const;
+#endif
virtual bool Write(wxString& str) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str);
+#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return _T("stringlist"); };
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataStringList::Write(ostream& str) const
{
wxString s;
str << (const char*) s.mb_str();
return TRUE;
}
+#endif
bool wxVariantDataStringList::Write(wxString& str) const
{
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataStringList::Read(istream& WXUNUSED(str))
{
wxFAIL_MSG(_T("Unimplemented"));
// TODO
return FALSE;
}
+#endif
bool wxVariantDataStringList::Read(wxString& WXUNUSED(str))
{
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str);
virtual bool Write(ostream& str) const;
-
+#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
return (otherData.m_value == m_value);
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataLong::Write(ostream& str) const
{
wxString s;
str << (const char*) s.mb_str();
return TRUE;
}
+#endif
bool wxVariantDataLong::Write(wxString& str) const
{
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataLong::Read(istream& str)
{
str >> m_value;
return TRUE;
}
+#endif
#if wxUSE_STREAMS
bool wxVariantDataLong::Write(wxOutputStream& str) const
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
virtual bool Read(wxString& str);
+#if wxUSE_STD_IOSTREAM
virtual bool Write(ostream& str) const;
+#endif
virtual bool Write(wxString& str) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str);
+#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
return (otherData.m_value == m_value);
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataReal::Write(ostream& str) const
{
wxString s;
str << (const char*) s.mb_str();
return TRUE;
}
+#endif
bool wxVariantDataReal::Write(wxString& str) const
{
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataReal::Read(istream& str)
{
str >> m_value;
return TRUE;
}
+#endif
#if wxUSE_STREAMS
bool wxVariantDataReal::Write(wxOutputStream& str) const
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Write(ostream& str) const;
+#endif
virtual bool Write(wxString& str) const;
virtual bool Read(wxString& str);
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str);
+#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
return (otherData.m_value == m_value);
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataBool::Write(ostream& str) const
{
wxString s;
str << (const char*) s.mb_str();
return TRUE;
}
+#endif
bool wxVariantDataBool::Write(wxString& str) const
{
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataBool::Read(istream& WXUNUSED(str))
{
wxFAIL_MSG(_T("Unimplemented"));
// str >> (long) m_value;
return FALSE;
}
+#endif
#if wxUSE_STREAMS
bool wxVariantDataBool::Write(wxOutputStream& str) const
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str);
virtual bool Write(ostream& str) const;
+#endif
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
#if wxUSE_STREAMS
return (otherData.m_value == m_value);
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataChar::Write(ostream& str) const
{
wxString s;
str << (const char*) s.mb_str();
return TRUE;
}
+#endif
bool wxVariantDataChar::Write(wxString& str) const
{
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataChar::Read(istream& WXUNUSED(str))
{
wxFAIL_MSG(_T("Unimplemented"));
// str >> m_value;
return FALSE;
}
+#endif
#if wxUSE_STREAMS
bool wxVariantDataChar::Write(wxOutputStream& str) const
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Write(ostream& str) const;
+#endif
virtual bool Read(wxString& str);
virtual bool Write(wxString& str) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str);
+#endif
#if wxUSE_STREAMS
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
return (otherData.m_value == m_value);
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataString::Write(ostream& str) const
{
str << (const char*) m_value.mb_str();
return TRUE;
}
+#endif
bool wxVariantDataString::Write(wxString& str) const
{
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataString::Read(istream& str)
{
str >> m_value;
return TRUE;
}
+#endif
#if wxUSE_STREAMS
bool wxVariantDataString::Write(wxOutputStream& str) const
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Write(ostream& str) const;
+#endif
virtual bool Write(wxString& str) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str);
+#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return _T("time"); };
virtual wxVariantData* Clone() { return new wxVariantDataTime; }
return (otherData.m_value == m_value);
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataTime::Write(ostream& str) const
{
wxString s;
str << (const char*) s.mb_str();
return TRUE;
}
+#endif
bool wxVariantDataTime::Write(wxString& str) const
{
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataTime::Read(istream& WXUNUSED(str))
{
// Not implemented
return FALSE;
}
+#endif
bool wxVariantDataTime::Read(wxString& WXUNUSED(str))
{
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Write(ostream& str) const;
+#endif
virtual bool Write(wxString& str) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str);
+#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return _T("date"); };
virtual wxVariantData* Clone() { return new wxVariantDataDate; }
return (otherData.m_value == m_value);
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataDate::Write(ostream& str) const
{
wxString s;
str << (const char*) s.mb_str();
return TRUE;
}
+#endif
bool wxVariantDataDate::Write(wxString& str) const
{
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataDate::Read(istream& WXUNUSED(str))
{
// Not implemented
return FALSE;
}
+#endif
bool wxVariantDataDate::Read(wxString& WXUNUSED(str))
{
virtual void Copy(wxVariantData& data);
virtual bool Eq(wxVariantData& data) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Write(ostream& str) const;
+#endif
virtual bool Write(wxString& str) const;
+#if wxUSE_STD_IOSTREAM
virtual bool Read(istream& str);
+#endif
virtual bool Read(wxString& str);
virtual wxString GetType() const { return _T("void*"); };
virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; }
return (otherData.m_value == m_value);
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataVoidPtr::Write(ostream& str) const
{
wxString s;
str << (const char*) s.mb_str();
return TRUE;
}
+#endif
bool wxVariantDataVoidPtr::Write(wxString& str) const
{
return TRUE;
}
+#if wxUSE_STD_IOSTREAM
bool wxVariantDataVoidPtr::Read(istream& WXUNUSED(str))
{
// Not implemented
return FALSE;
}
+#endif
bool wxVariantDataVoidPtr::Read(wxString& WXUNUSED(str))
{
EVT_UPDATE_UI(wxID_REDO, wxTextCtrl::OnUpdateRedo)
END_EVENT_TABLE()
-#ifndef NO_TEXT_WINDOW_STREAM
+#if wxUSE_STD_IOSTREAM
wxTextCtrl::wxTextCtrl() : streambuf()
{
if (allocate()) setp(base(),ebuf());
}
#endif
-#ifndef NO_TEXT_WINDOW_STREAM
+#if wxUSE_STD_IOSTREAM
wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
const wxPoint &pos, const wxSize &size,
int style, const wxValidator& validator, const wxString &name ) : streambuf()
key_event.Skip();
}
-#ifndef NO_TEXT_WINDOW_STREAM
+#if wxUSE_STD_IOSTREAM
int wxTextCtrl::overflow( int WXUNUSED(c) )
{
int len = pptr() - pbase();
{
return EOF;
}
+#endif
wxTextCtrl& wxTextCtrl::operator<<(const wxString& s)
{
AppendText(buf);
return *this;
}
-#endif
GtkWidget* wxTextCtrl::GetConnectWidget()
{
EVT_UPDATE_UI(wxID_REDO, wxTextCtrl::OnUpdateRedo)
END_EVENT_TABLE()
-#ifndef NO_TEXT_WINDOW_STREAM
+#if wxUSE_STD_IOSTREAM
wxTextCtrl::wxTextCtrl() : streambuf()
{
if (allocate()) setp(base(),ebuf());
}
#endif
-#ifndef NO_TEXT_WINDOW_STREAM
+#if wxUSE_STD_IOSTREAM
wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
const wxPoint &pos, const wxSize &size,
int style, const wxValidator& validator, const wxString &name ) : streambuf()
key_event.Skip();
}
-#ifndef NO_TEXT_WINDOW_STREAM
+#if wxUSE_STD_IOSTREAM
int wxTextCtrl::overflow( int WXUNUSED(c) )
{
int len = pptr() - pbase();
{
return EOF;
}
+#endif
wxTextCtrl& wxTextCtrl::operator<<(const wxString& s)
{
AppendText(buf);
return *this;
}
-#endif
GtkWidget* wxTextCtrl::GetConnectWidget()
{