1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Text stream classes
4 // Author: Guilhem Lavaux
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_TXTSTREAM_H_
13 #define _WX_TXTSTREAM_H_
16 #pragma interface "txtstrm.h"
19 #include "wx/stream.h"
23 class WXDLLEXPORT wxTextInputStream
;
24 class WXDLLEXPORT wxTextOutputStream
;
26 typedef wxTextInputStream
& (*__wxTextInputManip
)(wxTextInputStream
&);
27 typedef wxTextOutputStream
& (*__wxTextOutputManip
)(wxTextOutputStream
&);
29 WXDLLEXPORT wxTextOutputStream
&endl( wxTextOutputStream
&stream
);
31 class WXDLLEXPORT wxTextInputStream
{
33 wxTextInputStream(wxInputStream
& s
, const wxChar
&sep
=wxT(' '));
40 wxString
ReadString(); // deprecated use ReadLine or ReadWord instead
44 wxChar
GetStringSeparator() const { return m_string_separator
;}
45 void SetStringSeparator(const wxChar
&c
) { m_string_separator
=c
;}
48 wxTextInputStream
& operator>>(wxString
& word
);
49 wxTextInputStream
& operator>>(wxChar
& c
);
50 wxTextInputStream
& operator>>(wxInt16
& i
);
51 wxTextInputStream
& operator>>(wxInt32
& i
);
52 wxTextInputStream
& operator>>(wxUint16
& i
);
53 wxTextInputStream
& operator>>(wxUint32
& i
);
54 wxTextInputStream
& operator>>(double& i
);
55 wxTextInputStream
& operator>>(float& f
);
57 wxTextInputStream
& operator>>( __wxTextInputManip func
) { return func(*this); }
60 wxInputStream
*m_input
;
61 wxChar m_string_separator
;
63 wxChar
NextNonWhiteSpace();
64 void SkipIfEndOfLine( wxChar c
);
67 class WXDLLEXPORT wxTextOutputStream
{
69 wxTextOutputStream(wxOutputStream
& s
);
70 ~wxTextOutputStream();
72 void Write32(wxUint32 i
);
73 void Write16(wxUint16 i
);
74 void Write8(wxUint8 i
);
75 void WriteDouble(double d
);
76 void WriteString(const wxString
& string
);
78 wxTextOutputStream
& operator<<(const wxChar
*string
);
79 wxTextOutputStream
& operator<<(const wxString
& string
);
80 wxTextOutputStream
& operator<<(wxChar c
);
81 wxTextOutputStream
& operator<<(wxInt16 c
);
82 wxTextOutputStream
& operator<<(wxInt32 c
);
83 wxTextOutputStream
& operator<<(wxUint16 c
);
84 wxTextOutputStream
& operator<<(wxUint32 c
);
85 wxTextOutputStream
& operator<<(double f
);
86 wxTextOutputStream
& operator<<(float f
);
88 wxTextOutputStream
& operator<<( __wxTextOutputManip func
) { return func(*this); }
91 wxOutputStream
*m_output
;