1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Data stream classes
4 // Author: Guilhem Lavaux
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows licence
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 WXDLLIMPEXP_BASE 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
;
64 DECLARE_NO_COPY_CLASS(wxDataInputStream
)
67 class WXDLLIMPEXP_BASE wxDataOutputStream
71 wxDataOutputStream(wxOutputStream
& s
, wxMBConv
& conv
= wxConvUTF8
);
73 wxDataOutputStream(wxOutputStream
& s
);
75 ~wxDataOutputStream();
77 bool IsOk() { return m_output
->IsOk(); }
79 void Write64(wxUint64 i
);
80 void Write32(wxUint32 i
);
81 void Write16(wxUint16 i
);
82 void Write8(wxUint8 i
);
83 void WriteDouble(double d
);
84 void WriteString(const wxString
& string
);
86 wxDataOutputStream
& operator<<(const wxChar
*string
);
87 wxDataOutputStream
& operator<<(const wxString
& string
);
88 wxDataOutputStream
& operator<<(wxInt8 c
);
89 wxDataOutputStream
& operator<<(wxInt16 i
);
90 wxDataOutputStream
& operator<<(wxInt32 i
);
91 wxDataOutputStream
& operator<<(wxUint8 c
);
92 wxDataOutputStream
& operator<<(wxUint16 i
);
93 wxDataOutputStream
& operator<<(wxUint32 i
);
94 wxDataOutputStream
& operator<<(wxUint64 i
);
95 wxDataOutputStream
& operator<<(double f
);
96 wxDataOutputStream
& operator<<(float f
);
98 void BigEndianOrdered(bool be_order
) { m_be_order
= be_order
; }
101 wxOutputStream
*m_output
;
107 DECLARE_NO_COPY_CLASS(wxDataOutputStream
)