]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: sckstrm.h | |
3 | // Purpose: wxSocket*Stream | |
4 | // Author: Guilhem Lavaux | |
5 | // Modified by: | |
6 | // Created: 17/07/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | #ifndef __SCK_STREAM_H__ | |
12 | #define __SCK_STREAM_H__ | |
13 | ||
14 | #if defined(__GNUG__) && !defined(__APPLE__) | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "wx/stream.h" | |
19 | ||
20 | #if wxUSE_SOCKETS && wxUSE_STREAMS | |
21 | ||
22 | #include "wx/socket.h" | |
23 | ||
24 | class WXDLLIMPEXP_BASE wxSocketOutputStream : public wxOutputStream | |
25 | { | |
26 | public: | |
27 | wxSocketOutputStream(wxSocketBase& s); | |
28 | ~wxSocketOutputStream(); | |
29 | ||
30 | off_t SeekO( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) ) | |
31 | { return -1; } | |
32 | off_t TellO() const | |
33 | { return -1; } | |
34 | ||
35 | protected: | |
36 | wxSocketBase *m_o_socket; | |
37 | ||
38 | size_t OnSysWrite(const void *buffer, size_t bufsize); | |
39 | ||
40 | DECLARE_NO_COPY_CLASS(wxSocketOutputStream) | |
41 | }; | |
42 | ||
43 | class WXDLLIMPEXP_BASE wxSocketInputStream : public wxInputStream | |
44 | { | |
45 | public: | |
46 | wxSocketInputStream(wxSocketBase& s); | |
47 | ~wxSocketInputStream(); | |
48 | ||
49 | off_t SeekI( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) ) | |
50 | { return -1; } | |
51 | off_t TellI() const | |
52 | { return -1; } | |
53 | ||
54 | protected: | |
55 | wxSocketBase *m_i_socket; | |
56 | ||
57 | size_t OnSysRead(void *buffer, size_t bufsize); | |
58 | ||
59 | DECLARE_NO_COPY_CLASS(wxSocketInputStream) | |
60 | }; | |
61 | ||
62 | class WXDLLIMPEXP_BASE wxSocketStream : public wxSocketInputStream, | |
63 | public wxSocketOutputStream | |
64 | { | |
65 | public: | |
66 | wxSocketStream(wxSocketBase& s); | |
67 | ~wxSocketStream(); | |
68 | }; | |
69 | ||
70 | #endif | |
71 | // wxUSE_SOCKETS && wxUSE_STREAMS | |
72 | ||
73 | #endif | |
74 | // __SCK_STREAM_H__ |