* New wxStreams (to be documented), new classes: wxBufferedStreams,
[wxWidgets.git] / include / wx / txtstrm.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: txtstrm.h
3 // Purpose: Text 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
12 #ifndef _WX_TXTSTREAM_H_
13 #define _WX_TXTSTREAM_H_
14
15 #ifdef __GNUG__
16 #pragma interface "txtstrm.h"
17 #endif
18
19 #include <wx/stream.h>
20
21 #if wxUSE_STREAMS
22
23 class WXDLLEXPORT wxTextInputStream {
24 public:
25 wxTextInputStream(wxInputStream& s);
26 ~wxTextInputStream();
27
28 wxUint32 Read32();
29 wxUint16 Read16();
30 wxUint8 Read8();
31 double ReadDouble();
32 wxString ReadString();
33
34 // Operators
35 wxTextInputStream& operator>>(wxString& line);
36 wxTextInputStream& operator>>(wxInt8& c);
37 wxTextInputStream& operator>>(wxInt16& i);
38 wxTextInputStream& operator>>(wxInt32& i);
39 wxTextInputStream& operator>>(wxUint8& c);
40 wxTextInputStream& operator>>(wxUint16& i);
41 wxTextInputStream& operator>>(wxUint32& i);
42 wxTextInputStream& operator>>(double& i);
43 wxTextInputStream& operator>>(float& f);
44
45 protected:
46 wxInputStream *m_input;
47 };
48
49 class WXDLLEXPORT wxTextOutputStream {
50 public:
51 wxTextOutputStream(wxOutputStream& s);
52 ~wxTextOutputStream();
53
54 void Write32(wxUint32 i);
55 void Write16(wxUint16 i);
56 void Write8(wxUint8 i);
57 void WriteDouble(double d);
58 void WriteString(const wxString& string);
59
60 wxTextOutputStream& operator<<(const wxChar *string);
61 wxTextOutputStream& operator<<(const wxString& string);
62 wxTextOutputStream& operator<<(wxInt8 c);
63 wxTextOutputStream& operator<<(wxInt16 c);
64 wxTextOutputStream& operator<<(wxInt32 c);
65 wxTextOutputStream& operator<<(wxUint8 c);
66 wxTextOutputStream& operator<<(wxUint16 c);
67 wxTextOutputStream& operator<<(wxUint32 c);
68 wxTextOutputStream& operator<<(double f);
69 wxTextOutputStream& operator<<(float f);
70
71 protected:
72 wxOutputStream *m_output;
73 };
74
75 #endif
76 // wxUSE_STREAMS
77
78 #endif
79 // _WX_DATSTREAM_H_