1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Data stream classes
4 // Author: Guilhem Lavaux
5 // Modified by: Mickael Gilabert
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DATSTREAM_H_
13 #define _WX_DATSTREAM_H_
15 #include "wx/stream.h"
16 #include "wx/longlong.h"
17 #include "wx/strconv.h"
21 class WXDLLIMPEXP_BASE wxDataInputStream
25 wxDataInputStream(wxInputStream
& s
, wxMBConv
& conv
= wxConvUTF8
);
27 wxDataInputStream(wxInputStream
& s
);
29 ~wxDataInputStream(){}
31 bool IsOk() { return m_input
->IsOk(); }
38 wxString
ReadString();
40 void Read64(wxUint64
*buffer
, size_t size
);
41 void Read32(wxUint32
*buffer
, size_t size
);
42 void Read16(wxUint16
*buffer
, size_t size
);
43 void Read8(wxUint8
*buffer
, size_t size
);
44 void ReadDouble(double *buffer
, size_t size
);
46 wxDataInputStream
& operator>>(wxString
& s
);
47 wxDataInputStream
& operator>>(wxInt8
& c
);
48 wxDataInputStream
& operator>>(wxInt16
& i
);
49 wxDataInputStream
& operator>>(wxInt32
& i
);
50 wxDataInputStream
& operator>>(wxUint8
& c
);
51 wxDataInputStream
& operator>>(wxUint16
& i
);
52 wxDataInputStream
& operator>>(wxUint32
& i
);
53 wxDataInputStream
& operator>>(wxUint64
& i
);
54 wxDataInputStream
& operator>>(double& i
);
55 wxDataInputStream
& operator>>(float& f
);
57 void BigEndianOrdered(bool be_order
) { m_be_order
= be_order
; }
60 wxInputStream
*m_input
;
66 DECLARE_NO_COPY_CLASS(wxDataInputStream
)
69 class WXDLLIMPEXP_BASE wxDataOutputStream
73 wxDataOutputStream(wxOutputStream
& s
, wxMBConv
& conv
= wxConvUTF8
);
75 wxDataOutputStream(wxOutputStream
& s
);
77 ~wxDataOutputStream(){}
79 bool IsOk() { return m_output
->IsOk(); }
81 void Write64(wxUint64 i
);
82 void Write32(wxUint32 i
);
83 void Write16(wxUint16 i
);
84 void Write8(wxUint8 i
);
85 void WriteDouble(double d
);
86 void WriteString(const wxString
& string
);
88 void Write64(const wxUint64
*buffer
, size_t size
);
89 void Write32(const wxUint32
*buffer
, size_t size
);
90 void Write16(const wxUint16
*buffer
, size_t size
);
91 void Write8(const wxUint8
*buffer
, size_t size
);
92 void WriteDouble(const double *buffer
, size_t size
);
94 wxDataOutputStream
& operator<<(const wxChar
*string
);
95 wxDataOutputStream
& operator<<(const wxString
& string
);
96 wxDataOutputStream
& operator<<(wxInt8 c
);
97 wxDataOutputStream
& operator<<(wxInt16 i
);
98 wxDataOutputStream
& operator<<(wxInt32 i
);
99 wxDataOutputStream
& operator<<(wxUint8 c
);
100 wxDataOutputStream
& operator<<(wxUint16 i
);
101 wxDataOutputStream
& operator<<(wxUint32 i
);
102 wxDataOutputStream
& operator<<(wxUint64 i
);
103 wxDataOutputStream
& operator<<(double f
);
104 wxDataOutputStream
& operator<<(float f
);
106 void BigEndianOrdered(bool be_order
) { m_be_order
= be_order
; }
109 wxOutputStream
*m_output
;
115 DECLARE_NO_COPY_CLASS(wxDataOutputStream
)