* wxData*Stream update.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@264
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual bool Eof() const = 0;
virtual size_t LastRead() const = 0;
virtual bool Eof() const = 0;
virtual size_t LastRead() const = 0;
+
+ wxInputStream& operator>>(wxOutputStream& out) { return Read(out); }
};
class wxOutputStream: virtual public wxObject {
};
class wxOutputStream: virtual public wxObject {
virtual void Sync() {}
};
virtual void Sync() {}
};
-class wxStream: virtual public wxInputStream, virtual public wxOutputStream {
- public:
- wxStream() {}
- virtual ~wxStream() { }
-};
-
{ 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); }
{ 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(); }
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); }
{ 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(); }
virtual bool Bad() const { return m_parent_o_stream->Bad(); }
virtual size_t LastWrite() const { return m_parent_o_stream->LastWrite(); }
- if (!m_parent_i_stream)
- return 0;
-
Read(buf, 4);
return (unsigned long)buf[0] |
Read(buf, 4);
return (unsigned long)buf[0] |
- if (!m_parent_i_stream)
- return 0;
-
Read(buf, 2);
return (unsigned short)buf[0] |
Read(buf, 2);
return (unsigned short)buf[0] |
- if (!m_parent_i_stream)
- return 0;
-
Read(&buf, 1);
return (unsigned char)buf;
}
Read(&buf, 1);
return (unsigned char)buf;
}
#if USE_APPLE_IEEE
char buf[10];
#if USE_APPLE_IEEE
char buf[10];
- if (!m_parent_i_stream)
- return 0.0;
-
Read(buf, 10);
return ConvertFromIeeeExtended((unsigned char *)buf);
#else
Read(buf, 10);
return ConvertFromIeeeExtended((unsigned char *)buf);
#else
- if (!m_parent_i_stream)
- return "";
-
// TODO: Implement ReadLine
return i_strg;
}
// TODO: Implement ReadLine
return i_strg;
}
char *string;
unsigned long len;
char *string;
unsigned long len;
- if (!m_parent_i_stream)
- return "";
-
len = Read32();
string = new char[len+1];
len = Read32();
string = new char[len+1];
- if (!m_parent_o_stream)
- return;
-
buf[0] = i & 0xff;
buf[1] = (i >> 8) & 0xff;
buf[2] = (i >> 16) & 0xff;
buf[0] = i & 0xff;
buf[1] = (i >> 8) & 0xff;
buf[2] = (i >> 16) & 0xff;
- if (!m_parent_o_stream)
- return;
-
buf[0] = i & 0xff;
buf[1] = (i >> 8) & 0xff;
Write(buf, 2);
buf[0] = i & 0xff;
buf[1] = (i >> 8) & 0xff;
Write(buf, 2);
void wxDataOutputStream::Write8(unsigned char i)
{
void wxDataOutputStream::Write8(unsigned char i)
{
- if (!m_parent_o_stream)
- return;
-
wxString tmp_string = line + '\n';
#endif
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)
{
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());
}
Write32(string.Length());
Write((const char *) string, string.Length());
}
- if (!m_parent_o_stream)
- return;
-
#if USE_APPLE_IEEE
ConvertToIeeeExtended(d, (unsigned char *)buf);
#else
#if USE_APPLE_IEEE
ConvertToIeeeExtended(d, (unsigned char *)buf);
#else
+wxMemoryInputStream::~wxMemoryInputStream()
+{
+}
+
wxInputStream& wxMemoryInputStream::Read(void *buffer, size_t size)
{
if (m_iolimit == 2) {
wxInputStream& wxMemoryInputStream::Read(void *buffer, size_t size)
{
if (m_iolimit == 2) {
+wxMemoryOutputStream::~wxMemoryOutputStream()
+{
+}
+
wxOutputStream& wxMemoryOutputStream::Write(const void *buffer, size_t size)
{
if (m_iolimit == 1) {
wxOutputStream& wxMemoryOutputStream::Write(const void *buffer, size_t size)
{
if (m_iolimit == 1) {