virtual bool Eof() const = 0;
virtual size_t LastRead() const = 0;
+
+ wxInputStream& operator>>(wxOutputStream& out) { return Read(out); }
};
class wxOutputStream: virtual public wxObject {
virtual void Sync() {}
};
-class wxStream: virtual public wxInputStream, virtual public wxOutputStream {
- public:
- wxStream() {}
- virtual ~wxStream() { }
-};
-
/*
* "Filter" streams
*/
{ 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(); }
{ 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(); }
{
char buf[4];
- if (!m_parent_i_stream)
- return 0;
-
Read(buf, 4);
return (unsigned long)buf[0] |
{
char buf[2];
- if (!m_parent_i_stream)
- return 0;
-
Read(buf, 2);
return (unsigned short)buf[0] |
{
char buf;
- if (!m_parent_i_stream)
- return 0;
-
Read(&buf, 1);
return (unsigned char)buf;
}
#if USE_APPLE_IEEE
char buf[10];
- if (!m_parent_i_stream)
- return 0.0;
-
Read(buf, 10);
return ConvertFromIeeeExtended((unsigned char *)buf);
#else
{
char i_strg[255];
- if (!m_parent_i_stream)
- return "";
-
// TODO: Implement ReadLine
return i_strg;
}
char *string;
unsigned long len;
- if (!m_parent_i_stream)
- return "";
-
len = Read32();
string = new char[len+1];
{
char buf[4];
- if (!m_parent_o_stream)
- return;
-
buf[0] = i & 0xff;
buf[1] = (i >> 8) & 0xff;
buf[2] = (i >> 16) & 0xff;
{
char buf[2];
- if (!m_parent_o_stream)
- return;
-
buf[0] = i & 0xff;
buf[1] = (i >> 8) & 0xff;
Write(buf, 2);
void wxDataOutputStream::Write8(unsigned char i)
{
- if (!m_parent_o_stream)
- return;
-
Write(&i, 1);
}
wxString tmp_string = line + '\n';
#endif
- if (!m_parent_o_stream)
- return;
-
Write((const char *) tmp_string, tmp_string.Length());
}
void wxDataOutputStream::WriteString(const wxString& string)
{
- if (!m_parent_o_stream)
- return;
-
Write32(string.Length());
Write((const char *) string, string.Length());
}
{
char buf[10];
- if (!m_parent_o_stream)
- return;
-
#if USE_APPLE_IEEE
ConvertToIeeeExtended(d, (unsigned char *)buf);
#else
m_iolimit = 1;
}
+wxMemoryInputStream::~wxMemoryInputStream()
+{
+}
+
wxInputStream& wxMemoryInputStream::Read(void *buffer, size_t size)
{
if (m_iolimit == 2) {
m_iolimit = 2;
}
+wxMemoryOutputStream::~wxMemoryOutputStream()
+{
+}
+
wxOutputStream& wxMemoryOutputStream::Write(const void *buffer, size_t size)
{
if (m_iolimit == 1) {