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