]> git.saurik.com Git - wxWidgets.git/blame - include/wx/datstrm.h
16-bit fixes
[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"
cf447356 20
ce4169a4
RR
21#if wxUSE_STREAMS
22
fae05df5 23class WXDLLEXPORT wxDataInputStream {
cf447356 24public:
3d4c6a21 25 wxDataInputStream(wxInputStream& s);
fae05df5 26 ~wxDataInputStream();
cf447356 27
7b8bd818
GL
28 wxUint32 Read32();
29 wxUint16 Read16();
30 wxUint8 Read8();
cf447356 31 double ReadDouble();
eafc087e 32 wxString ReadString();
fae05df5
GL
33
34 wxDataInputStream& operator>>(wxString& s);
35 wxDataInputStream& operator>>(wxInt8& c);
36 wxDataInputStream& operator>>(wxInt16& i);
37 wxDataInputStream& operator>>(wxInt32& i);
38 wxDataInputStream& operator>>(wxUint8& c);
39 wxDataInputStream& operator>>(wxUint16& i);
40 wxDataInputStream& operator>>(wxUint32& i);
41 wxDataInputStream& operator>>(double& i);
42 wxDataInputStream& operator>>(float& f);
5a96d2f4 43
60b6c062 44 void BigEndianOrdered(bool be_order) { m_be_order = be_order; }
fae05df5
GL
45 protected:
46 wxInputStream *m_input;
5a96d2f4 47 bool m_be_order;
3d4c6a21
GL
48};
49
fae05df5 50class WXDLLEXPORT wxDataOutputStream {
3d4c6a21
GL
51 public:
52 wxDataOutputStream(wxOutputStream& s);
fae05df5 53 ~wxDataOutputStream();
cf447356 54
7b8bd818
GL
55 void Write32(wxUint32 i);
56 void Write16(wxUint16 i);
57 void Write8(wxUint8 i);
cf447356 58 void WriteDouble(double d);
eafc087e 59 void WriteString(const wxString& string);
fae05df5
GL
60
61 wxDataOutputStream& operator<<(const wxChar *string);
62 wxDataOutputStream& operator<<(wxString& string);
63 wxDataOutputStream& operator<<(wxInt8 c);
64 wxDataOutputStream& operator<<(wxInt16 i);
65 wxDataOutputStream& operator<<(wxInt32 i);
66 wxDataOutputStream& operator<<(wxUint8 c);
67 wxDataOutputStream& operator<<(wxUint16 i);
68 wxDataOutputStream& operator<<(wxUint32 i);
69 wxDataOutputStream& operator<<(double f);
70 wxDataOutputStream& operator<<(float f);
71
60b6c062 72 void BigEndianOrdered(bool be_order) { m_be_order = be_order; }
fae05df5
GL
73 protected:
74 wxOutputStream *m_output;
5a96d2f4 75 bool m_be_order;
cf447356
GL
76};
77
ce4169a4
RR
78#endif
79 // wxUSE_STREAMS
80
cf447356 81#endif
34138703 82 // _WX_DATSTREAM_H_