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"
20 #include "wx/longlong.h"
24 class WXDLLEXPORT wxDataInputStream
27 wxDataInputStream(wxInputStream
& s
);
30 bool IsOk() { return m_input
->IsOk(); }
37 wxString
ReadString();
39 wxDataInputStream
& operator>>(wxString
& s
);
40 wxDataInputStream
& operator>>(wxInt8
& c
);
41 wxDataInputStream
& operator>>(wxInt16
& i
);
42 wxDataInputStream
& operator>>(wxInt32
& i
);
43 wxDataInputStream
& operator>>(wxUint8
& c
);
44 wxDataInputStream
& operator>>(wxUint16
& i
);
45 wxDataInputStream
& operator>>(wxUint32
& i
);
46 wxDataInputStream
& operator>>(wxUint64
& i
);
47 wxDataInputStream
& operator>>(double& i
);
48 wxDataInputStream
& operator>>(float& f
);
50 void BigEndianOrdered(bool be_order
) { m_be_order
= be_order
; }
53 wxInputStream
*m_input
;
57 class WXDLLEXPORT wxDataOutputStream
60 wxDataOutputStream(wxOutputStream
& s
);
61 ~wxDataOutputStream();
63 bool IsOk() { return m_output
->IsOk(); }
65 void Write64(wxUint64 i
);
66 void Write32(wxUint32 i
);
67 void Write16(wxUint16 i
);
68 void Write8(wxUint8 i
);
69 void WriteDouble(double d
);
70 void WriteString(const wxString
& string
);
72 wxDataOutputStream
& operator<<(const wxChar
*string
);
73 wxDataOutputStream
& operator<<(const wxString
& string
);
74 wxDataOutputStream
& operator<<(wxInt8 c
);
75 wxDataOutputStream
& operator<<(wxInt16 i
);
76 wxDataOutputStream
& operator<<(wxInt32 i
);
77 wxDataOutputStream
& operator<<(wxUint8 c
);
78 wxDataOutputStream
& operator<<(wxUint16 i
);
79 wxDataOutputStream
& operator<<(wxUint32 i
);
80 wxDataOutputStream
& operator<<(wxUint64 i
);
81 wxDataOutputStream
& operator<<(double f
);
82 wxDataOutputStream
& operator<<(float f
);
84 void BigEndianOrdered(bool be_order
) { m_be_order
= be_order
; }
87 wxOutputStream
*m_output
;