]>
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 | #ifdef __GNUG__ | |
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 WXDLLEXPORT 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 | ||
41 | class WXDLLEXPORT wxSocketInputStream : public wxInputStream | |
42 | { | |
43 | public: | |
44 | wxSocketInputStream(wxSocketBase& s); | |
45 | ~wxSocketInputStream(); | |
46 | ||
47 | off_t SeekI( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) ) | |
48 | { return -1; } | |
49 | off_t TellI() const | |
50 | { return -1; } | |
51 | ||
52 | protected: | |
53 | wxSocketBase *m_i_socket; | |
54 | ||
55 | size_t OnSysRead(void *buffer, size_t bufsize); | |
56 | }; | |
57 | ||
58 | class WXDLLEXPORT wxSocketStream : public wxSocketInputStream, | |
59 | public wxSocketOutputStream | |
60 | { | |
61 | public: | |
62 | wxSocketStream(wxSocketBase& s); | |
63 | ~wxSocketStream(); | |
64 | }; | |
65 | ||
66 | #endif | |
67 | // wxUSE_SOCKETS && wxUSE_STREAMS | |
68 | ||
69 | #endif | |
70 | // __SCK_STREAM_H__ |