wxOutputStream& operator<<( __wxOutputManip func) { return func(*this); }
};
+// ---------------------------------------------------------------------------
+// A stream for measuring streamed output
+// ---------------------------------------------------------------------------
+
+class wxCountingOutputStream: public wxOutputStream {
+ public:
+ wxCountingOutputStream();
+
+ size_t GetSize() const;
+ bool Ok() const { return TRUE; }
+
+ protected:
+
+ size_t OnSysWrite(const void *buffer, size_t size);
+ off_t OnSysSeek(off_t pos, wxSeekMode mode);
+ off_t OnSysTell() const;
+
+ protected:
+ size_t m_currentPos;
+};
+
+
// ---------------------------------------------------------------------------
// "Filter" streams
// ---------------------------------------------------------------------------
char Peek() { return m_parent_i_stream->Peek(); }
- wxStreamError LastError() const { return m_parent_i_stream->LastError(); }
size_t GetSize() const { return m_parent_i_stream->GetSize(); }
protected:
wxFilterOutputStream(wxOutputStream& stream);
~wxFilterOutputStream();
- wxStreamError LastError() const { return m_parent_o_stream->LastError(); }
size_t GetSize() const { return m_parent_o_stream->GetSize(); }
protected:
size_t Write(const void *buffer, size_t size);
size_t Write(wxStreamBuffer *buf);
+ char Peek();
char GetChar();
void PutChar(char c);
off_t Tell() const;
char *m_buffer_start, *m_buffer_end, *m_buffer_pos;
size_t m_buffer_size;
- char *m_wback;
- size_t m_wbacksize, m_wbackcur;
-
bool m_fixed, m_flushable;
wxStreamBase *m_stream;
wxBufferedInputStream(wxInputStream& stream);
~wxBufferedInputStream();
+ char Peek();
wxInputStream& Read(void *buffer, size_t size);
// Position functions