-class WXDLLEXPORT wxOutputStream {
- public:
- wxOutputStream();
- virtual ~wxOutputStream();
-
- virtual wxOutputStream& Write(const void *buffer, size_t size);
- wxOutputStream& Write(wxInputStream& stream_in);
-
- virtual off_t SeekO(off_t pos, wxSeekMode mode = wxFromStart);
- virtual off_t TellO() const;
-
- virtual bool Bad() const { return m_bad; }
- virtual size_t LastWrite() const { return m_lastwrite; }
- wxStreamBuffer *OutputStreamBuffer() { return m_o_streambuf; }
-
- virtual void Sync();
-
- wxOutputStream& operator<<(wxInputStream& out) { return Write(out); }
- 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<<(double f);
- wxOutputStream& operator<<(wxObject& obj);
-
- 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:
- friend class wxStreamBuffer;
- friend class wxFilterOutputStream;
-
- wxOutputStream(wxStreamBuffer *buffer);
-
- virtual size_t DoWrite(const void *buffer, size_t size) { return 0; }
- virtual off_t DoSeekOutput(off_t pos, wxSeekMode mode)
- { return wxInvalidOffset; }
- virtual off_t DoTellOutput() const
- { return wxInvalidOffset; }
-
- protected:
- bool m_bad, m_o_destroybuf;
- size_t m_lastwrite;
- wxStreamBuffer *m_o_streambuf;
+class WXDLLEXPORT wxOutputStream: public wxStreamBase
+{
+public:
+ wxOutputStream();
+ virtual ~wxOutputStream();
+
+ void PutC(char c);
+ virtual wxOutputStream& Write(const void *buffer, size_t size);
+ wxOutputStream& Write(wxInputStream& stream_in);
+
+ virtual off_t SeekO(off_t pos, wxSeekMode mode = wxFromStart);
+ virtual off_t TellO() const;
+
+ virtual size_t LastWrite() const { return wxStreamBase::m_lastcount; }
+
+ virtual void Sync();
+
+ wxOutputStream& operator<<(wxInputStream& out) { return Write(out); }
+#if wxUSE_SERIAL
+ wxOutputStream& operator<<(wxObject& obj);
+#endif
+ wxOutputStream& operator<<( __wxOutputManip func) { return func(*this); }