#endif
#include <stdio.h>
-#include <wx/object.h>
-#include <wx/string.h>
+#include "wx/object.h"
+#include "wx/string.h"
+#include "wx/filefn.h" // for off_t and wxSeekMode
/*
* wxStream: base classes
*/
-
-typedef enum {
- wxFromStart, wxFromCurrent, wxFromEnd
-} wxSeekMode;
-
class wxOutputStream;
-class wxInputStream: virtual public wxObject {
- DECLARE_ABSTRACT_CLASS(wxInputStream)
+class wxInputStream {
public:
wxInputStream();
virtual ~wxInputStream();
virtual bool Eof() const = 0;
virtual size_t LastRead() const = 0;
+
+ wxInputStream& operator>>(wxOutputStream& out) { return Read(out); }
};
-class wxOutputStream: virtual public wxObject {
- DECLARE_ABSTRACT_CLASS(wxOutputStream)
+class wxOutputStream {
public:
wxOutputStream();
virtual ~wxOutputStream();
virtual void Sync() {}
};
-class wxStream: virtual public wxInputStream, virtual public wxOutputStream {
- public:
- wxStream() {}
- virtual ~wxStream() { }
-};
-
/*
* "Filter" streams
*/
class wxFilterInputStream: public wxInputStream {
- DECLARE_CLASS(wxFilterInputStream)
public:
wxFilterInputStream(wxInputStream& stream);
virtual ~wxFilterInputStream();
{ return m_parent_i_stream->Read(buffer, size); }
virtual off_t SeekI(off_t pos, wxSeekMode mode = wxFromStart)
{ return m_parent_i_stream->SeekI(pos, mode); }
+ virtual off_t TellI() const
+ { return m_parent_i_stream->TellI(); }
virtual bool Eof() const { return m_parent_i_stream->Eof(); }
virtual size_t LastRead() const { return m_parent_i_stream->LastRead(); }
};
class wxFilterOutputStream: public wxOutputStream {
- DECLARE_CLASS(wxFilterOutputStream)
public:
wxFilterOutputStream(wxOutputStream& stream);
virtual ~wxFilterOutputStream();
{ return m_parent_o_stream->Write(buffer, size); }
virtual off_t SeekO(off_t pos, wxSeekMode mode = wxFromStart)
{ return m_parent_o_stream->SeekO(pos, mode); }
+ virtual off_t TellO() const
+ { return m_parent_o_stream->TellO(); }
virtual bool Bad() const { return m_parent_o_stream->Bad(); }
virtual size_t LastWrite() const { return m_parent_o_stream->LastWrite(); }