]>
Commit | Line | Data |
---|---|---|
fae05df5 GL |
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 | ||
ed58dbea | 19 | #include "wx/stream.h" |
fae05df5 GL |
20 | |
21 | #if wxUSE_STREAMS | |
22 | ||
65045edd RR |
23 | class WXDLLEXPORT wxTextInputStream; |
24 | class WXDLLEXPORT wxTextOutputStream; | |
25 | ||
26 | typedef wxTextInputStream& (*__wxTextInputManip)(wxTextInputStream&); | |
27 | typedef wxTextOutputStream& (*__wxTextOutputManip)(wxTextOutputStream&); | |
28 | ||
29 | WXDLLEXPORT wxTextOutputStream &endl( wxTextOutputStream &stream ); | |
30 | ||
fae05df5 GL |
31 | class WXDLLEXPORT wxTextInputStream { |
32 | public: | |
33 | wxTextInputStream(wxInputStream& s); | |
34 | ~wxTextInputStream(); | |
35 | ||
36 | wxUint32 Read32(); | |
37 | wxUint16 Read16(); | |
38 | wxUint8 Read8(); | |
39 | double ReadDouble(); | |
40 | wxString ReadString(); | |
41 | ||
42 | // Operators | |
43 | wxTextInputStream& operator>>(wxString& line); | |
940ddb19 | 44 | wxTextInputStream& operator>>(wxChar& c); |
fae05df5 GL |
45 | wxTextInputStream& operator>>(wxInt16& i); |
46 | wxTextInputStream& operator>>(wxInt32& i); | |
fae05df5 GL |
47 | wxTextInputStream& operator>>(wxUint16& i); |
48 | wxTextInputStream& operator>>(wxUint32& i); | |
49 | wxTextInputStream& operator>>(double& i); | |
50 | wxTextInputStream& operator>>(float& f); | |
65045edd RR |
51 | |
52 | wxTextInputStream& operator>>( __wxTextInputManip func) { return func(*this); } | |
53 | ||
fae05df5 GL |
54 | protected: |
55 | wxInputStream *m_input; | |
cd25b18c RR |
56 | |
57 | wxChar NextNonWhiteSpace(); | |
58 | void SkipIfEndOfLine( wxChar c ); | |
fae05df5 GL |
59 | }; |
60 | ||
61 | class WXDLLEXPORT wxTextOutputStream { | |
62 | public: | |
63 | wxTextOutputStream(wxOutputStream& s); | |
64 | ~wxTextOutputStream(); | |
65 | ||
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); | |
cd25b18c | 71 | |
fae05df5 GL |
72 | wxTextOutputStream& operator<<(const wxChar *string); |
73 | wxTextOutputStream& operator<<(const wxString& string); | |
940ddb19 | 74 | wxTextOutputStream& operator<<(wxChar c); |
fae05df5 GL |
75 | wxTextOutputStream& operator<<(wxInt16 c); |
76 | wxTextOutputStream& operator<<(wxInt32 c); | |
fae05df5 GL |
77 | wxTextOutputStream& operator<<(wxUint16 c); |
78 | wxTextOutputStream& operator<<(wxUint32 c); | |
79 | wxTextOutputStream& operator<<(double f); | |
80 | wxTextOutputStream& operator<<(float f); | |
81 | ||
65045edd RR |
82 | wxTextOutputStream& operator<<( __wxTextOutputManip func) { return func(*this); } |
83 | ||
fae05df5 GL |
84 | protected: |
85 | wxOutputStream *m_output; | |
86 | }; | |
87 | ||
88 | #endif | |
89 | // wxUSE_STREAMS | |
90 | ||
91 | #endif | |
92 | // _WX_DATSTREAM_H_ |