]> git.saurik.com Git - wxWidgets.git/blame - include/wx/datstrm.h
maintaint the mouse capture stack in all ports, not just wxUniv
[wxWidgets.git] / include / wx / datstrm.h
CommitLineData
cf447356
GL
1/////////////////////////////////////////////////////////////////////////////
2// Name: datstrm.h
3// Purpose: Data stream classes
4// Author: Guilhem Lavaux
5// Modified by:
6// Created: 28/06/1998
7// RCS-ID: $Id$
8// Copyright: (c) Guilhem Lavaux
9// Licence: wxWindows license
10/////////////////////////////////////////////////////////////////////////////
11
34138703
JS
12#ifndef _WX_DATSTREAM_H_
13#define _WX_DATSTREAM_H_
cf447356
GL
14
15#ifdef __GNUG__
16#pragma interface "datstrm.h"
17#endif
18
ed58dbea 19#include "wx/stream.h"
41b0a113 20#include "wx/longlong.h"
cf447356 21
ce4169a4
RR
22#if wxUSE_STREAMS
23
4c075b70
RR
24class WXDLLEXPORT wxDataInputStream
25{
cf447356 26public:
4c075b70
RR
27 wxDataInputStream(wxInputStream& s);
28 ~wxDataInputStream();
7eb0e037
RR
29
30 bool IsOk() { return m_input->IsOk(); }
cf447356 31
41b0a113 32 wxUint64 Read64();
4c075b70
RR
33 wxUint32 Read32();
34 wxUint16 Read16();
35 wxUint8 Read8();
36 double ReadDouble();
37 wxString ReadString();
fae05df5 38
4c075b70
RR
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);
41b0a113 46 wxDataInputStream& operator>>(wxUint64& i);
4c075b70
RR
47 wxDataInputStream& operator>>(double& i);
48 wxDataInputStream& operator>>(float& f);
5a96d2f4 49
4c075b70 50 void BigEndianOrdered(bool be_order) { m_be_order = be_order; }
38caaa61 51
4c075b70
RR
52protected:
53 wxInputStream *m_input;
54 bool m_be_order;
3d4c6a21
GL
55};
56
4c075b70
RR
57class WXDLLEXPORT wxDataOutputStream
58{
59public:
60 wxDataOutputStream(wxOutputStream& s);
61 ~wxDataOutputStream();
cf447356 62
7eb0e037
RR
63 bool IsOk() { return m_output->IsOk(); }
64
41b0a113 65 void Write64(wxUint64 i);
4c075b70
RR
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);
fae05df5 71
4c075b70 72 wxDataOutputStream& operator<<(const wxChar *string);
38caaa61 73 wxDataOutputStream& operator<<(const wxString& string);
4c075b70
RR
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);
41b0a113 80 wxDataOutputStream& operator<<(wxUint64 i);
4c075b70
RR
81 wxDataOutputStream& operator<<(double f);
82 wxDataOutputStream& operator<<(float f);
fae05df5 83
38caaa61
KB
84 void BigEndianOrdered(bool be_order) { m_be_order = be_order; }
85
4c075b70
RR
86protected:
87 wxOutputStream *m_output;
88 bool m_be_order;
cf447356
GL
89};
90
ce4169a4
RR
91#endif
92 // wxUSE_STREAMS
93
cf447356 94#endif
34138703 95 // _WX_DATSTREAM_H_