From dd107c50be43e8d4dbdba20df162faf119a3781c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 6 Jun 2001 16:51:53 +0000 Subject: [PATCH] applied patch for compilation with gcc 3.0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10445 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/samples/ogl/ogledit/doc.cpp | 6 +-- contrib/samples/ogl/ogledit/doc.h | 7 ++-- contrib/src/ogl/ogldiag.cpp | 2 +- demos/forty/scoredg.cpp | 2 +- include/wx/date.h | 2 +- include/wx/defs.h | 11 +++++ include/wx/docview.h | 8 ++-- include/wx/ioswrap.h | 2 + include/wx/log.h | 4 +- include/wx/longlong.h | 4 +- include/wx/memory.h | 12 +++--- include/wx/object.h | 2 +- include/wx/string.h | 4 +- include/wx/textctrl.h | 7 ++++ include/wx/variant.h | 4 +- samples/docview/doc.cpp | 8 ++-- samples/docview/doc.h | 12 +++--- samples/docvwmdi/doc.cpp | 8 ++-- samples/docvwmdi/doc.h | 12 +++--- samples/typetest/typetest.cpp | 4 +- src/common/docview.cpp | 12 +++--- src/common/log.cpp | 6 +-- src/common/longlong.cpp | 6 +-- src/common/memory.cpp | 16 ++++---- src/common/object.cpp | 2 +- src/common/string.cpp | 4 +- src/common/variant.cpp | 80 ++++++++++++++++++------------------- utils/HelpGen/src/cjparser.h | 8 ++-- utils/tex2rtf/src/tex2rtf.cpp | 2 +- utils/tex2rtf/src/texutils.cpp | 16 ++++---- 30 files changed, 146 insertions(+), 127 deletions(-) diff --git a/contrib/samples/ogl/ogledit/doc.cpp b/contrib/samples/ogl/ogledit/doc.cpp index 3557696..25dae36 100644 --- a/contrib/samples/ogl/ogledit/doc.cpp +++ b/contrib/samples/ogl/ogledit/doc.cpp @@ -34,7 +34,7 @@ #include "view.h" #if wxUSE_STD_IOSTREAM -#include +#include #endif IMPLEMENT_DYNAMIC_CLASS(DiagramDocument, wxDocument) @@ -54,7 +54,7 @@ bool DiagramDocument::OnCloseDocument(void) } #if wxUSE_STD_IOSTREAM -ostream& DiagramDocument::SaveObject(ostream& stream) +wxSTD ostream& DiagramDocument::SaveObject(wxSTD ostream& stream) { wxDocument::SaveObject(stream); @@ -69,7 +69,7 @@ ostream& DiagramDocument::SaveObject(ostream& stream) return stream; } -istream& DiagramDocument::LoadObject(istream& stream) +wxSTD istream& DiagramDocument::LoadObject(wxSTD istream& stream) { wxDocument::LoadObject(stream); diff --git a/contrib/samples/ogl/ogledit/doc.h b/contrib/samples/ogl/ogledit/doc.h index 09a841d..c39f5f0 100644 --- a/contrib/samples/ogl/ogledit/doc.h +++ b/contrib/samples/ogl/ogledit/doc.h @@ -23,8 +23,7 @@ #include #if wxUSE_STD_IOSTREAM -class ostream; -class istream; + #include #endif /* @@ -98,8 +97,8 @@ class DiagramDocument: public wxDocument ~DiagramDocument(void); #if wxUSE_STD_IOSTREAM - virtual ostream& SaveObject(ostream& stream); - virtual istream& LoadObject(istream& stream); + virtual wxSTD ostream& SaveObject(wxSTD ostream& stream); + virtual wxSTD istream& LoadObject(wxSTD istream& stream); #else virtual wxOutputStream& SaveObject(wxOutputStream& stream); virtual wxInputStream& LoadObject(wxInputStream& stream); diff --git a/contrib/src/ogl/ogldiag.cpp b/contrib/src/ogl/ogldiag.cpp index 6698e5b..2eac015 100644 --- a/contrib/src/ogl/ogldiag.cpp +++ b/contrib/src/ogl/ogldiag.cpp @@ -33,7 +33,7 @@ #include #include #ifdef _MSC_VER -using namespace std; +//using namespace std; #endif #endif diff --git a/demos/forty/scoredg.cpp b/demos/forty/scoredg.cpp index 136fff7..9f96c61 100644 --- a/demos/forty/scoredg.cpp +++ b/demos/forty/scoredg.cpp @@ -35,7 +35,7 @@ #endif #else #include -using namespace std; +//using namespace std; #endif #include "scorefil.h" #include "scoredg.h" diff --git a/include/wx/date.h b/include/wx/date.h index 09e8e00..635457d9 100644 --- a/include/wx/date.h +++ b/include/wx/date.h @@ -90,7 +90,7 @@ public: wxDate &operator--(int) { return *this -= 1; } #if wxUSE_STD_IOSTREAM - friend ostream WXDLLEXPORT & operator <<(ostream &os, const wxDate &dt) + friend wxSTD ostream WXDLLEXPORT & operator <<(wxSTD ostream &os, const wxDate &dt) { return os << dt.FormatDate().mb_str(); } #endif diff --git a/include/wx/defs.h b/include/wx/defs.h index b778266..aaa9693 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -55,6 +55,17 @@ #include "wx/setup.h" +// old C++ headers (like ) declare classes in the global namespace +// while the new, standard ones (like ) do it in std:: namespace +// +// using this macro allows constuctions like "wxSTD iostream" to work in +// either case +#if !wxUSE_IOSTREAMH + #define wxSTD std:: +#else + #define wxSTD +#endif + // just in case they were defined in setup.h #ifdef PACKAGE #undef PACKAGE diff --git a/include/wx/docview.h b/include/wx/docview.h index 1672e1c..99c6c86 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -89,8 +89,8 @@ public: virtual bool Revert(); #if wxUSE_STD_IOSTREAM - virtual ostream& SaveObject(ostream& stream); - virtual istream& LoadObject(istream& stream); + virtual wxSTD ostream& SaveObject(wxSTD ostream& stream); + virtual wxSTD istream& LoadObject(wxSTD istream& stream); #else virtual wxOutputStream& SaveObject(wxOutputStream& stream); virtual wxInputStream& LoadObject(wxInputStream& stream); @@ -634,8 +634,8 @@ protected: #if wxUSE_STD_IOSTREAM // For compatibility with existing file formats: // converts from/to a stream to/from a temporary file. -bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, ostream& stream); -bool WXDLLEXPORT wxTransferStreamToFile(istream& stream, const wxString& filename); +bool WXDLLEXPORT wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream); +bool WXDLLEXPORT wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename); #else // For compatibility with existing file formats: // converts from/to a stream to/from a temporary file. diff --git a/include/wx/ioswrap.h b/include/wx/ioswrap.h index 8d2ad89..2934375 100644 --- a/include/wx/ioswrap.h +++ b/include/wx/ioswrap.h @@ -16,9 +16,11 @@ # include #else # include +# if 0 // this is not needed any longer now that we have wxSTD # if defined(__VISUALC__) || defined(__MWERKS__) using namespace std; # endif +#endif // 0 #endif #endif diff --git a/include/wx/log.h b/include/wx/log.h index 43fae9c..a47fff3 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -251,14 +251,14 @@ class WXDLLEXPORT wxLogStream : public wxLog { public: // redirect log output to an ostream - wxLogStream(ostream *ostr = (ostream *) NULL); + wxLogStream(wxSTD ostream *ostr = (wxSTD ostream *) NULL); protected: // implement sink function virtual void DoLogString(const wxChar *szString, time_t t); // using ptr here to avoid including from this file - ostream *m_ostr; + wxSTD ostream *m_ostr; }; #endif diff --git a/include/wx/longlong.h b/include/wx/longlong.h index 607859c..621abc3 100644 --- a/include/wx/longlong.h +++ b/include/wx/longlong.h @@ -308,7 +308,7 @@ public: #if wxUSE_STD_IOSTREAM // input/output - friend ostream& operator<<(ostream&, const wxLongLongNative&); + friend wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongNative&); #endif private: @@ -490,7 +490,7 @@ public: // input/output #if wxUSE_STD_IOSTREAM - friend ostream& operator<<(ostream&, const wxLongLongWx&); + friend wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongWx&); #endif // wxUSE_STD_IOSTREAM void *asArray() const; diff --git a/include/wx/memory.h b/include/wx/memory.h index b5bf5e5..26c46b3 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -34,7 +34,7 @@ #else # include # if defined(__VISUALC__) || defined(__MWERKS__) - using namespace std; +// using namespace std; # endif #endif @@ -227,8 +227,8 @@ protected: // Traverse the list. static void TraverseList (PmSFV, wxMemStruct *from = NULL); - static streambuf *m_streamBuf; - static ostream *m_debugStream; + static wxSTD streambuf *m_streamBuf; + static wxSTD ostream *m_debugStream; static int debugLevel; static bool debugOn; @@ -244,9 +244,9 @@ public: ~wxDebugContext(void); static bool HasStream(void) { return (m_debugStream != NULL); }; - static ostream& GetStream(void) { return *m_debugStream; } - static streambuf *GetStreamBuf(void) { return m_streamBuf; } - static void SetStream(ostream *stream, streambuf *buf = NULL); + static wxSTD ostream& GetStream(void) { return *m_debugStream; } + static wxSTD streambuf *GetStreamBuf(void) { return m_streamBuf; } + static void SetStream(wxSTD ostream *stream, streambuf *buf = NULL); static bool SetFile(const wxString& file); static bool SetStandardError(void); diff --git a/include/wx/object.h b/include/wx/object.h index 4603f3b..03a23d0 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -254,7 +254,7 @@ class WXDLLEXPORT wxObject #endif // Debug & memory tracing #if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT) - virtual void Dump(ostream& str); + virtual void Dump(wxSTD ostream& str); #endif #if wxUSE_SERIAL diff --git a/include/wx/string.h b/include/wx/string.h index 0a59b41..26ac232 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -1148,8 +1148,8 @@ inline wxString operator+(const wxCharBuffer& buf, const wxString& string) #include "wx/ioswrap.h" -WXDLLEXPORT istream& operator>>(istream&, wxString&); -WXDLLEXPORT ostream& operator<<(ostream&, const wxString&); +WXDLLEXPORT wxSTD istream& operator>>(wxSTD istream&, wxString&); +WXDLLEXPORT wxSTD ostream& operator<<(wxSTD ostream&, const wxString&); #endif // wxSTD_STRING_COMPATIBILITY diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index eb02d1d..d268922 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -31,6 +31,13 @@ #define NO_TEXT_WINDOW_STREAM #endif +// the streambuf which is used in the declaration of wxTextCtrlBase below is not compatible +// with the standard-conforming implementation found in newer egcs versions +// (that is, the libstdc++ v3 that is shipped with it) +#if defined(__GNUC__)&&( (__GNUC__>2) ||( (__GNUC__==2)&&(__GNUC_MINOR__>97) ) ) + #define NO_TEXT_WINDOW_STREAM +#endif + #ifndef NO_TEXT_WINDOW_STREAM #if wxUSE_STD_IOSTREAM #include "wx/ioswrap.h" // for iostream classes if we need them diff --git a/include/wx/variant.h b/include/wx/variant.h index f8c08df..0e3d738 100644 --- a/include/wx/variant.h +++ b/include/wx/variant.h @@ -55,11 +55,11 @@ public: virtual void Copy(wxVariantData& data) = 0; virtual bool Eq(wxVariantData& data) const = 0; #if wxUSE_STD_IOSTREAM - virtual bool Write(ostream& str) const = 0; + virtual bool Write(wxSTD ostream& str) const = 0; #endif virtual bool Write(wxString& str) const = 0; #if wxUSE_STD_IOSTREAM - virtual bool Read(istream& str) = 0; + virtual bool Read(wxSTD istream& str) = 0; #endif virtual bool Read(wxString& str) = 0; // What type is it? Return a string name. diff --git a/samples/docview/doc.cpp b/samples/docview/doc.cpp index 864981f..725d39d 100644 --- a/samples/docview/doc.cpp +++ b/samples/docview/doc.cpp @@ -44,7 +44,7 @@ DrawingDocument::~DrawingDocument(void) } #if wxUSE_STD_IOSTREAM -ostream& DrawingDocument::SaveObject(ostream& stream) +wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream) { wxDocument::SaveObject(stream); @@ -88,7 +88,7 @@ wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream) #endif #if wxUSE_STD_IOSTREAM -istream& DrawingDocument::LoadObject(istream& stream) +wxSTD istream& DrawingDocument::LoadObject(wxSTD istream& stream) { wxDocument::LoadObject(stream); @@ -153,7 +153,7 @@ DoodleSegment::~DoodleSegment(void) } #if wxUSE_STD_IOSTREAM -ostream& DoodleSegment::SaveObject(ostream& stream) +wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream) { wxInt32 n = lines.Number(); stream << n << '\n'; @@ -195,7 +195,7 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream) #endif #if wxUSE_STD_IOSTREAM -istream& DoodleSegment::LoadObject(istream& stream) +wxSTD istream& DoodleSegment::LoadObject(wxSTD istream& stream) { wxInt32 n = 0; stream >> n; diff --git a/samples/docview/doc.h b/samples/docview/doc.h index 06ec872..eed0e8d 100644 --- a/samples/docview/doc.h +++ b/samples/docview/doc.h @@ -40,8 +40,8 @@ public: void Draw(wxDC *dc); #if wxUSE_STD_IOSTREAM - ostream& SaveObject(ostream& text_stream); - istream& LoadObject(istream& text_stream); + wxSTD ostream& SaveObject(wxSTD ostream& text_stream); + wxSTD istream& LoadObject(wxSTD istream& text_stream); #else wxOutputStream& SaveObject(wxOutputStream& stream); wxInputStream& LoadObject(wxInputStream& stream); @@ -60,8 +60,8 @@ public: ~DrawingDocument(void); #if wxUSE_STD_IOSTREAM - ostream& SaveObject(ostream& text_stream); - istream& LoadObject(istream& text_stream); + wxSTD ostream& SaveObject(wxSTD ostream& text_stream); + wxSTD istream& LoadObject(wxSTD istream& text_stream); #else wxOutputStream& SaveObject(wxOutputStream& stream); wxInputStream& LoadObject(wxInputStream& stream); @@ -93,8 +93,8 @@ class TextEditDocument: public wxDocument private: public: /* -ostream& SaveObject(ostream& stream); -istream& LoadObject(istream& stream); +wxSTD ostream& SaveObject(wxSTD ostream& stream); +wxSTD istream& LoadObject(wxSTD istream& stream); */ virtual bool OnSaveDocument(const wxString& filename); virtual bool OnOpenDocument(const wxString& filename); diff --git a/samples/docvwmdi/doc.cpp b/samples/docvwmdi/doc.cpp index fe26f59..c5be85a 100644 --- a/samples/docvwmdi/doc.cpp +++ b/samples/docvwmdi/doc.cpp @@ -44,7 +44,7 @@ DrawingDocument::~DrawingDocument(void) } #if wxUSE_STD_IOSTREAM -ostream& DrawingDocument::SaveObject(ostream& stream) +wxSTD ostream& DrawingDocument::SaveObject(wxSTD ostream& stream) { wxDocument::SaveObject(stream); @@ -88,7 +88,7 @@ wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream) #endif #if wxUSE_STD_IOSTREAM -istream& DrawingDocument::LoadObject(istream& stream) +wxSTD istream& DrawingDocument::LoadObject(wxSTD istream& stream) { wxDocument::LoadObject(stream); @@ -152,7 +152,7 @@ DoodleSegment::~DoodleSegment(void) } #if wxUSE_STD_IOSTREAM -ostream& DoodleSegment::SaveObject(ostream& stream) +wxSTD ostream& DoodleSegment::SaveObject(wxSTD ostream& stream) { wxInt32 n = lines.Number(); stream << n << '\n'; @@ -194,7 +194,7 @@ wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream) #endif #if wxUSE_STD_IOSTREAM -istream& DoodleSegment::LoadObject(istream& stream) +wxSTD istream& DoodleSegment::LoadObject(wxSTD istream& stream) { wxInt32 n = 0; stream >> n; diff --git a/samples/docvwmdi/doc.h b/samples/docvwmdi/doc.h index ce250ff..b6c4a69 100644 --- a/samples/docvwmdi/doc.h +++ b/samples/docvwmdi/doc.h @@ -41,8 +41,8 @@ class DoodleSegment: public wxObject void Draw(wxDC *dc); #if wxUSE_STD_IOSTREAM - ostream& SaveObject(ostream& text_stream); - istream& LoadObject(istream& text_stream); + wxSTD ostream& SaveObject(wxSTD ostream& text_stream); + wxSTD istream& LoadObject(wxSTD istream& text_stream); #else wxOutputStream& SaveObject(wxOutputStream& stream); wxInputStream& LoadObject(wxInputStream& stream); @@ -60,8 +60,8 @@ class DrawingDocument: public wxDocument ~DrawingDocument(void); #if wxUSE_STD_IOSTREAM - ostream& SaveObject(ostream& text_stream); - istream& LoadObject(istream& text_stream); + wxSTD ostream& SaveObject(wxSTD ostream& text_stream); + wxSTD istream& LoadObject(wxSTD istream& text_stream); #else wxOutputStream& SaveObject(wxOutputStream& stream); wxInputStream& LoadObject(wxInputStream& stream); @@ -93,8 +93,8 @@ class TextEditDocument: public wxDocument private: public: /* - ostream& SaveObject(ostream& stream); - istream& LoadObject(istream& stream); + wxSTD ostream& SaveObject(wxSTD ostream& stream); + wxSTD istream& LoadObject(wxSTD istream& stream); */ virtual bool OnSaveDocument(const wxString& filename); virtual bool OnOpenDocument(const wxString& filename); diff --git a/samples/typetest/typetest.cpp b/samples/typetest/typetest.cpp index 26cf405..4e86e88 100644 --- a/samples/typetest/typetest.cpp +++ b/samples/typetest/typetest.cpp @@ -125,7 +125,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event)) textCtrl.WriteText( "Writing to ofstream and wxFileOutputStream:\n" ); - ofstream std_file_output( "test_std.dat" ); + wxSTD ofstream std_file_output( "test_std.dat" ); wxFileOutputStream file_output( wxString("test_wx.dat") ); wxBufferedOutputStream buf_output( file_output ); wxTextOutputStream text_output( buf_output ); @@ -163,7 +163,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event)) textCtrl.WriteText( "\nReading from ifstream:\n" ); - ifstream std_file_input( "test_std.dat" ); + wxSTD ifstream std_file_input( "test_std.dat" ); std_file_input >> si; tmp.Printf( _T("Signed int: %d\n"), si ); diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 549eb66..2be6963 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -296,7 +296,7 @@ bool wxDocument::OnSaveDocument(const wxString& file) msgTitle = wxString(_("File error")); #if wxUSE_STD_IOSTREAM - ofstream store(wxString(file.fn_str()).mb_str()); + wxSTD ofstream store(wxString(file.fn_str()).mb_str()); if (store.fail() || store.bad()) #else wxFileOutputStream store(wxString(file.fn_str())); @@ -332,7 +332,7 @@ bool wxDocument::OnOpenDocument(const wxString& file) msgTitle = wxString(_("File error")); #if wxUSE_STD_IOSTREAM - ifstream store(wxString(file.fn_str()).mb_str()); + wxSTD ifstream store(wxString(file.fn_str()).mb_str()); if (store.fail() || store.bad()) #else wxFileInputStream store(wxString(file.fn_str())); @@ -365,7 +365,7 @@ bool wxDocument::OnOpenDocument(const wxString& file) } #if wxUSE_STD_IOSTREAM -istream& wxDocument::LoadObject(istream& stream) +wxSTD istream& wxDocument::LoadObject(wxSTD istream& stream) #else wxInputStream& wxDocument::LoadObject(wxInputStream& stream) #endif @@ -374,7 +374,7 @@ wxInputStream& wxDocument::LoadObject(wxInputStream& stream) } #if wxUSE_STD_IOSTREAM -ostream& wxDocument::SaveObject(ostream& stream) +wxSTD ostream& wxDocument::SaveObject(wxSTD ostream& stream) #else wxOutputStream& wxDocument::SaveObject(wxOutputStream& stream) #endif @@ -2314,7 +2314,7 @@ void wxFileHistory::AddFilesToMenu(wxMenu* menu) // ---------------------------------------------------------------------------- #if wxUSE_STD_IOSTREAM -bool wxTransferFileToStream(const wxString& filename, ostream& stream) +bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream) { FILE *fd1; int ch; @@ -2329,7 +2329,7 @@ bool wxTransferFileToStream(const wxString& filename, ostream& stream) return TRUE; } -bool wxTransferStreamToFile(istream& stream, const wxString& filename) +bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename) { FILE *fd1; int ch; diff --git a/src/common/log.cpp b/src/common/log.cpp index a60e289..a73e2cd 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -556,10 +556,10 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) // ---------------------------------------------------------------------------- #if wxUSE_STD_IOSTREAM -wxLogStream::wxLogStream(ostream *ostr) +wxLogStream::wxLogStream(wxSTD ostream *ostr) { if ( ostr == NULL ) - m_ostr = &cerr; + m_ostr = &wxSTD cerr; else m_ostr = ostr; } @@ -568,7 +568,7 @@ void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) { wxString str; TimeStamp(&str); - (*m_ostr) << str << wxConvertWX2MB(szString) << endl; + (*m_ostr) << str << wxConvertWX2MB(szString) << wxSTD endl; } #endif // wxUSE_STD_IOSTREAM diff --git a/src/common/longlong.cpp b/src/common/longlong.cpp index 4569d20..129af17 100644 --- a/src/common/longlong.cpp +++ b/src/common/longlong.cpp @@ -60,11 +60,11 @@ void *wxLongLongNative::asArray() const #if wxUSE_STD_IOSTREAM // input/output -ostream& operator<< (ostream& o, const wxLongLongNative& ll) +wxSTD ostream& operator<< (wxSTD ostream& o, const wxLongLongNative& ll) { char result[65]; - memset(result, 'A', 64); + wxSTD memset(result, 'A', 64); result[64] = '\0'; @@ -629,7 +629,7 @@ void *wxLongLongWx::asArray(void) const #if wxUSE_STD_IOSTREAM // input/output -ostream& operator<< (ostream& o, const wxLongLongWx& ll) +wxSTD ostream& operator<< (wxSTD ostream& o, const wxLongLongWx& ll) { char result[65]; diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 2f97c44..24ef330 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -461,12 +461,12 @@ int wxMemStruct::ValidateNode () wxMemStruct *wxDebugContext::m_head = NULL; wxMemStruct *wxDebugContext::m_tail = NULL; -// ostream *wxDebugContext::m_debugStream = NULL; -// streambuf *wxDebugContext::m_streamBuf = NULL; +// wxSTD ostream *wxDebugContext::m_debugStream = NULL; +// wxSTD streambuf *wxDebugContext::m_streamBuf = NULL; // Must initialise these in wxEntry, and then delete them just before wxEntry exits -streambuf *wxDebugContext::m_streamBuf = NULL; -ostream *wxDebugContext::m_debugStream = NULL; +wxSTD streambuf *wxDebugContext::m_streamBuf = NULL; +wxSTD ostream *wxDebugContext::m_debugStream = NULL; bool wxDebugContext::m_checkPrevious = FALSE; int wxDebugContext::debugLevel = 1; @@ -481,7 +481,7 @@ int wxDebugContext::m_balignmask = (int)((char *)&markerCalc[1] - (char*)&marker wxDebugContext::wxDebugContext(void) { // m_streamBuf = new wxDebugStreamBuf; -// m_debugStream = new ostream(m_streamBuf); +// m_debugStream = new wxSTD ostream(m_streamBuf); } wxDebugContext::~wxDebugContext(void) @@ -494,7 +494,7 @@ wxDebugContext::~wxDebugContext(void) * between SetFile and SetStream. */ -void wxDebugContext::SetStream(ostream *str, streambuf *buf) +void wxDebugContext::SetStream(wxSTD ostream *str, streambuf *buf) { if (m_debugStream) { @@ -519,7 +519,7 @@ void wxDebugContext::SetStream(ostream *str, streambuf *buf) bool wxDebugContext::SetFile(const wxString& file) { - ofstream *str = new ofstream(file.mb_str()); + wxSTD ofstream *str = new wxSTD ofstream(file.mb_str()); if (str->bad()) { @@ -539,7 +539,7 @@ bool wxDebugContext::SetStandardError(void) #if 0 #if !defined(_WINDLL) wxDebugStreamBuf *buf = new wxDebugStreamBuf; - ostream *stream = new ostream(m_streamBuf); + wxSTD ostream *stream = new wxSTD ostream(m_streamBuf); SetStream(stream, buf); return TRUE; #else diff --git a/src/common/object.cpp b/src/common/object.cpp index c07c3c3..83a8fec 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -116,7 +116,7 @@ void wxObject::CopyObject(wxObject& WXUNUSED(object_dest)) const } #if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT) -void wxObject::Dump(ostream& str) +void wxObject::Dump(wxSTD ostream& str) { if (GetClassInfo() && GetClassInfo()->GetClassName()) str << GetClassInfo()->GetClassName(); diff --git a/src/common/string.cpp b/src/common/string.cpp index 917bd82..c1a8c1a 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -153,7 +153,7 @@ extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy; // // ATTN: you can _not_ use both of these in the same program! -istream& operator>>(istream& is, wxString& WXUNUSED(str)) +wxSTD istream& operator>>(wxSTD istream& is, wxString& WXUNUSED(str)) { #if 0 int w = is.width(0); @@ -184,7 +184,7 @@ istream& operator>>(istream& is, wxString& WXUNUSED(str)) return is; } -ostream& operator<<(ostream& os, const wxString& str) +wxSTD ostream& operator<<(wxSTD ostream& os, const wxString& str) { os << str.c_str(); return os; diff --git a/src/common/variant.cpp b/src/common/variant.cpp index a0c5b4b..0ada278 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -69,11 +69,11 @@ public: virtual void Copy(wxVariantData& data); virtual bool Eq(wxVariantData& data) const; #if wxUSE_STD_IOSTREAM - virtual bool Write(ostream& str) const; + virtual bool Write(wxSTD ostream& str) const; #endif virtual bool Write(wxString& str) const; #if wxUSE_STD_IOSTREAM - virtual bool Read(istream& str); + virtual bool Read(wxSTD istream& str); #endif virtual bool Read(wxString& str); virtual wxString GetType() const { return wxT("list"); }; @@ -157,7 +157,7 @@ bool wxVariantDataList::Eq(wxVariantData& data) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataList::Write(ostream& str) const +bool wxVariantDataList::Write(wxSTD ostream& str) const { wxString s; Write(s); @@ -184,7 +184,7 @@ bool wxVariantDataList::Write(wxString& str) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataList::Read(istream& WXUNUSED(str)) +bool wxVariantDataList::Read(wxSTD istream& WXUNUSED(str)) { wxFAIL_MSG(wxT("Unimplemented")); // TODO @@ -216,11 +216,11 @@ public: virtual void Copy(wxVariantData& data); virtual bool Eq(wxVariantData& data) const; #if wxUSE_STD_IOSTREAM - virtual bool Write(ostream& str) const; + virtual bool Write(wxSTD ostream& str) const; #endif virtual bool Write(wxString& str) const; #if wxUSE_STD_IOSTREAM - virtual bool Read(istream& str); + virtual bool Read(wxSTD istream& str); #endif virtual bool Read(wxString& str); virtual wxString GetType() const { return wxT("stringlist"); }; @@ -266,7 +266,7 @@ bool wxVariantDataStringList::Eq(wxVariantData& data) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataStringList::Write(ostream& str) const +bool wxVariantDataStringList::Write(wxSTD ostream& str) const { wxString s; Write(s); @@ -292,7 +292,7 @@ bool wxVariantDataStringList::Write(wxString& str) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataStringList::Read(istream& WXUNUSED(str)) +bool wxVariantDataStringList::Read(wxSTD istream& WXUNUSED(str)) { wxFAIL_MSG(wxT("Unimplemented")); // TODO @@ -327,8 +327,8 @@ public: 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; + virtual bool Read(wxSTD istream& str); + virtual bool Write(wxSTD ostream& str) const; #endif #if wxUSE_STREAMS virtual bool Read(wxInputStream& str); @@ -362,7 +362,7 @@ bool wxVariantDataLong::Eq(wxVariantData& data) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataLong::Write(ostream& str) const +bool wxVariantDataLong::Write(wxSTD ostream& str) const { wxString s; Write(s); @@ -378,7 +378,7 @@ bool wxVariantDataLong::Write(wxString& str) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataLong::Read(istream& str) +bool wxVariantDataLong::Read(wxSTD istream& str) { str >> m_value; return TRUE; @@ -426,11 +426,11 @@ public: virtual bool Eq(wxVariantData& data) const; virtual bool Read(wxString& str); #if wxUSE_STD_IOSTREAM - virtual bool Write(ostream& str) const; + virtual bool Write(wxSTD ostream& str) const; #endif virtual bool Write(wxString& str) const; #if wxUSE_STD_IOSTREAM - virtual bool Read(istream& str); + virtual bool Read(wxSTD istream& str); #endif #if wxUSE_STREAMS virtual bool Read(wxInputStream& str); @@ -463,7 +463,7 @@ bool wxVariantDataReal::Eq(wxVariantData& data) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataReal::Write(ostream& str) const +bool wxVariantDataReal::Write(wxSTD ostream& str) const { wxString s; Write(s); @@ -479,7 +479,7 @@ bool wxVariantDataReal::Write(wxString& str) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataReal::Read(istream& str) +bool wxVariantDataReal::Read(wxSTD istream& str) { str >> m_value; return TRUE; @@ -526,12 +526,12 @@ public: virtual void Copy(wxVariantData& data); virtual bool Eq(wxVariantData& data) const; #if wxUSE_STD_IOSTREAM - virtual bool Write(ostream& str) const; + virtual bool Write(wxSTD ostream& str) const; #endif virtual bool Write(wxString& str) const; virtual bool Read(wxString& str); #if wxUSE_STD_IOSTREAM - virtual bool Read(istream& str); + virtual bool Read(wxSTD istream& str); #endif #if wxUSE_STREAMS virtual bool Read(wxInputStream& str); @@ -564,7 +564,7 @@ bool wxVariantDataBool::Eq(wxVariantData& data) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataBool::Write(ostream& str) const +bool wxVariantDataBool::Write(wxSTD ostream& str) const { wxString s; Write(s); @@ -580,7 +580,7 @@ bool wxVariantDataBool::Write(wxString& str) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataBool::Read(istream& WXUNUSED(str)) +bool wxVariantDataBool::Read(wxSTD istream& WXUNUSED(str)) { wxFAIL_MSG(wxT("Unimplemented")); // str >> (long) m_value; @@ -630,8 +630,8 @@ public: 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; + virtual bool Read(wxSTD istream& str); + virtual bool Write(wxSTD ostream& str) const; #endif virtual bool Read(wxString& str); virtual bool Write(wxString& str) const; @@ -666,7 +666,7 @@ bool wxVariantDataChar::Eq(wxVariantData& data) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataChar::Write(ostream& str) const +bool wxVariantDataChar::Write(wxSTD ostream& str) const { wxString s; Write(s); @@ -682,7 +682,7 @@ bool wxVariantDataChar::Write(wxString& str) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataChar::Read(istream& WXUNUSED(str)) +bool wxVariantDataChar::Read(wxSTD istream& WXUNUSED(str)) { wxFAIL_MSG(wxT("Unimplemented")); // str >> m_value; @@ -740,12 +740,12 @@ public: virtual void Copy(wxVariantData& data); virtual bool Eq(wxVariantData& data) const; #if wxUSE_STD_IOSTREAM - virtual bool Write(ostream& str) const; + virtual bool Write(wxSTD ostream& str) const; #endif virtual bool Read(wxString& str); virtual bool Write(wxString& str) const; #if wxUSE_STD_IOSTREAM - virtual bool Read(istream& str); + virtual bool Read(wxSTD istream& str); #endif #if wxUSE_STREAMS virtual bool Read(wxInputStream& str); @@ -776,7 +776,7 @@ bool wxVariantDataString::Eq(wxVariantData& data) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataString::Write(ostream& str) const +bool wxVariantDataString::Write(wxSTD ostream& str) const { str << (const char*) m_value.mb_str(); return TRUE; @@ -790,7 +790,7 @@ bool wxVariantDataString::Write(wxString& str) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataString::Read(istream& str) +bool wxVariantDataString::Read(wxSTD istream& str) { str >> m_value; return TRUE; @@ -847,11 +847,11 @@ public: virtual void Copy(wxVariantData& data); virtual bool Eq(wxVariantData& data) const; #if wxUSE_STD_IOSTREAM - virtual bool Write(ostream& str) const; + virtual bool Write(wxSTD ostream& str) const; #endif virtual bool Write(wxString& str) const; #if wxUSE_STD_IOSTREAM - virtual bool Read(istream& str); + virtual bool Read(wxSTD istream& str); #endif virtual bool Read(wxString& str); virtual wxString GetType() const { return wxT("time"); }; @@ -882,7 +882,7 @@ bool wxVariantDataTime::Eq(wxVariantData& data) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataTime::Write(ostream& str) const +bool wxVariantDataTime::Write(wxSTD ostream& str) const { wxString s; Write(s); @@ -899,7 +899,7 @@ bool wxVariantDataTime::Write(wxString& str) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataTime::Read(istream& WXUNUSED(str)) +bool wxVariantDataTime::Read(wxSTD istream& WXUNUSED(str)) { // Not implemented return FALSE; @@ -929,11 +929,11 @@ public: virtual void Copy(wxVariantData& data); virtual bool Eq(wxVariantData& data) const; #if wxUSE_STD_IOSTREAM - virtual bool Write(ostream& str) const; + virtual bool Write(wxSTD ostream& str) const; #endif virtual bool Write(wxString& str) const; #if wxUSE_STD_IOSTREAM - virtual bool Read(istream& str); + virtual bool Read(wxSTD istream& str); #endif virtual bool Read(wxString& str); virtual wxString GetType() const { return wxT("date"); }; @@ -964,7 +964,7 @@ bool wxVariantDataDate::Eq(wxVariantData& data) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataDate::Write(ostream& str) const +bool wxVariantDataDate::Write(wxSTD ostream& str) const { wxString s; Write(s); @@ -980,7 +980,7 @@ bool wxVariantDataDate::Write(wxString& str) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataDate::Read(istream& WXUNUSED(str)) +bool wxVariantDataDate::Read(wxSTD istream& WXUNUSED(str)) { // Not implemented return FALSE; @@ -1012,11 +1012,11 @@ public: virtual void Copy(wxVariantData& data); virtual bool Eq(wxVariantData& data) const; #if wxUSE_STD_IOSTREAM - virtual bool Write(ostream& str) const; + virtual bool Write(wxSTD ostream& str) const; #endif virtual bool Write(wxString& str) const; #if wxUSE_STD_IOSTREAM - virtual bool Read(istream& str); + virtual bool Read(wxSTD istream& str); #endif virtual bool Read(wxString& str); virtual wxString GetType() const { return wxT("void*"); }; @@ -1047,7 +1047,7 @@ bool wxVariantDataVoidPtr::Eq(wxVariantData& data) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataVoidPtr::Write(ostream& str) const +bool wxVariantDataVoidPtr::Write(wxSTD ostream& str) const { wxString s; Write(s); @@ -1063,7 +1063,7 @@ bool wxVariantDataVoidPtr::Write(wxString& str) const } #if wxUSE_STD_IOSTREAM -bool wxVariantDataVoidPtr::Read(istream& WXUNUSED(str)) +bool wxVariantDataVoidPtr::Read(wxSTD istream& WXUNUSED(str)) { // Not implemented return FALSE; diff --git a/utils/HelpGen/src/cjparser.h b/utils/HelpGen/src/cjparser.h index 384b2b1..98663b8 100644 --- a/utils/HelpGen/src/cjparser.h +++ b/utils/HelpGen/src/cjparser.h @@ -15,7 +15,7 @@ #include "srcparser.h" -#include +#include #include #include #include @@ -70,9 +70,9 @@ protected: void AddEnumNode( char*& cur ); void AddTypeDefNode( char*& cur ); - void DumpOperationInfo( spOperation& info, const string& tab, ostream& os ); - void DumpClassHeader( spClass& info, ostream& os ); - void DumpClassBody( spClass& info, ostream& os ); + void DumpOperationInfo( spOperation& info, const string& tab, wxSTD ostream& os ); + void DumpClassHeader( spClass& info, wxSTD ostream& os ); + void DumpClassBody( spClass& info, wxSTD ostream& os ); public: diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp index 55f736a..cc8f64a 100644 --- a/utils/tex2rtf/src/tex2rtf.cpp +++ b/utils/tex2rtf/src/tex2rtf.cpp @@ -1312,7 +1312,7 @@ char *Tex2RTFConnection::OnRequest(const wxString& topic, const wxString& item, #ifndef NO_GUI #ifndef __WXGTK__ -//void wxObject::Dump(ostream& str) +//void wxObject::Dump(wxSTD ostream& str) //{ // if (GetClassInfo() && GetClassInfo()->GetClassName()) // str << GetClassInfo()->GetClassName(); diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index f3c25d4..ac68e43 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -378,7 +378,7 @@ void AddTexRef(char *name, char *file, char *sectionName, void WriteTexReferences(char *filename) { - ofstream ostr(filename); + wxSTD ofstream ostr(filename); if (ostr.bad()) return; char buf[200]; @@ -405,7 +405,7 @@ void ReadTexReferences(char *filename) if (!wxFileExists(filename)) return; - ifstream istr(filename, ios::in); + wxSTD ifstream istr(filename, ios::in); if (istr.bad()) return; @@ -450,7 +450,7 @@ void ReadTexReferences(char *filename) * */ -void BibEatWhiteSpace(istream& str) +void BibEatWhiteSpace(wxSTD istream& str) { char ch = str.peek(); @@ -478,7 +478,7 @@ void BibEatWhiteSpace(istream& str) } // Read word up to { or , or space -void BibReadWord(istream& istr, char *buffer) +void BibReadWord(wxSTD istream& istr, char *buffer) { int i = 0; buffer[i] = 0; @@ -495,7 +495,7 @@ void BibReadWord(istream& istr, char *buffer) } // Read string (double-quoted or not) to end quote or EOL -void BibReadToEOL(istream& istr, char *buffer) +void BibReadToEOL(wxSTD istream& istr, char *buffer) { int i = 0; buffer[i] = 0; @@ -524,7 +524,7 @@ void BibReadToEOL(istream& istr, char *buffer) } // Read }-terminated value, taking nested braces into account. -void BibReadValue(istream& istr, char *buffer, bool ignoreBraces = TRUE, +void BibReadValue(wxSTD istream& istr, char *buffer, bool ignoreBraces = TRUE, bool quotesMayTerminate = TRUE) { int braceCount = 1; @@ -580,7 +580,7 @@ bool ReadBib(char *filename) return FALSE; char buf[300]; - ifstream istr(filename, ios::in); + wxSTD ifstream istr(filename, ios::in); if (istr.bad()) return FALSE; BibLine = 1; @@ -1302,7 +1302,7 @@ bool ReadCustomMacros(char *filename) if (!wxFileExists(filename)) return FALSE; - ifstream istr(filename, ios::in); + wxSTD ifstream istr(filename, ios::in); if (istr.bad()) return FALSE; -- 2.7.4