1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Data stream classes
4 // Author: Guilhem Lavaux
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DATSTREAM_H_
13 #define _WX_DATSTREAM_H_
16 #pragma interface "datstrm.h"
19 #include "wx/stream.h"
23 class WXDLLEXPORT wxDataInputStream
26 wxDataInputStream(wxInputStream
& s
);
29 bool IsOk() { return m_input
->IsOk(); }
35 wxString
ReadString();
37 wxDataInputStream
& operator>>(wxString
& s
);
38 wxDataInputStream
& operator>>(wxInt8
& c
);
39 wxDataInputStream
& operator>>(wxInt16
& i
);
40 wxDataInputStream
& operator>>(wxInt32
& i
);
41 wxDataInputStream
& operator>>(wxUint8
& c
);
42 wxDataInputStream
& operator>>(wxUint16
& i
);
43 wxDataInputStream
& operator>>(wxUint32
& i
);
44 wxDataInputStream
& operator>>(double& i
);
45 wxDataInputStream
& operator>>(float& f
);
47 void BigEndianOrdered(bool be_order
) { m_be_order
= be_order
; }
50 wxInputStream
*m_input
;
54 class WXDLLEXPORT wxDataOutputStream
57 wxDataOutputStream(wxOutputStream
& s
);
58 ~wxDataOutputStream();
60 bool IsOk() { return m_output
->IsOk(); }
62 void Write32(wxUint32 i
);
63 void Write16(wxUint16 i
);
64 void Write8(wxUint8 i
);
65 void WriteDouble(double d
);
66 void WriteString(const wxString
& string
);
68 wxDataOutputStream
& operator<<(const wxChar
*string
);
69 wxDataOutputStream
& operator<<(const wxString
& string
);
70 wxDataOutputStream
& operator<<(wxInt8 c
);
71 wxDataOutputStream
& operator<<(wxInt16 i
);
72 wxDataOutputStream
& operator<<(wxInt32 i
);
73 wxDataOutputStream
& operator<<(wxUint8 c
);
74 wxDataOutputStream
& operator<<(wxUint16 i
);
75 wxDataOutputStream
& operator<<(wxUint32 i
);
76 wxDataOutputStream
& operator<<(double f
);
77 wxDataOutputStream
& operator<<(float f
);
79 void BigEndianOrdered(bool be_order
) { m_be_order
= be_order
; }
82 wxOutputStream
*m_output
;