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_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "datstrm.h"
19 #include "wx/stream.h"
20 #include "wx/longlong.h"
21 #include "wx/strconv.h"
25 class WXDLLEXPORT wxDataInputStream
29 wxDataInputStream(wxInputStream
& s
, wxMBConv
& conv
= wxConvUTF8
);
31 wxDataInputStream(wxInputStream
& s
);
35 bool IsOk() { return m_input
->IsOk(); }
42 wxString
ReadString();
44 wxDataInputStream
& operator>>(wxString
& s
);
45 wxDataInputStream
& operator>>(wxInt8
& c
);
46 wxDataInputStream
& operator>>(wxInt16
& i
);
47 wxDataInputStream
& operator>>(wxInt32
& i
);
48 wxDataInputStream
& operator>>(wxUint8
& c
);
49 wxDataInputStream
& operator>>(wxUint16
& i
);
50 wxDataInputStream
& operator>>(wxUint32
& i
);
51 wxDataInputStream
& operator>>(wxUint64
& i
);
52 wxDataInputStream
& operator>>(double& i
);
53 wxDataInputStream
& operator>>(float& f
);
55 void BigEndianOrdered(bool be_order
) { m_be_order
= be_order
; }
58 wxInputStream
*m_input
;
65 class WXDLLEXPORT wxDataOutputStream
69 wxDataOutputStream(wxOutputStream
& s
, wxMBConv
& conv
= wxConvUTF8
);
71 wxDataOutputStream(wxOutputStream
& s
);
73 ~wxDataOutputStream();
75 bool IsOk() { return m_output
->IsOk(); }
77 void Write64(wxUint64 i
);
78 void Write32(wxUint32 i
);
79 void Write16(wxUint16 i
);
80 void Write8(wxUint8 i
);
81 void WriteDouble(double d
);
82 void WriteString(const wxString
& string
);
84 wxDataOutputStream
& operator<<(const wxChar
*string
);
85 wxDataOutputStream
& operator<<(const wxString
& string
);
86 wxDataOutputStream
& operator<<(wxInt8 c
);
87 wxDataOutputStream
& operator<<(wxInt16 i
);
88 wxDataOutputStream
& operator<<(wxInt32 i
);
89 wxDataOutputStream
& operator<<(wxUint8 c
);
90 wxDataOutputStream
& operator<<(wxUint16 i
);
91 wxDataOutputStream
& operator<<(wxUint32 i
);
92 wxDataOutputStream
& operator<<(wxUint64 i
);
93 wxDataOutputStream
& operator<<(double f
);
94 wxDataOutputStream
& operator<<(float f
);
96 void BigEndianOrdered(bool be_order
) { m_be_order
= be_order
; }
99 wxOutputStream
*m_output
;