]>
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 | wxOutputStream& Write(const void *buffer, size_t size); | |
31 | off_t SeekO( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) ) | |
32 | { return -1; } | |
33 | off_t TellO() | |
34 | { return -1; } | |
35 | ||
36 | protected: | |
37 | wxSocketBase *m_o_socket; | |
38 | ||
39 | size_t OnSysWrite(const void *buffer, size_t bufsize); | |
40 | }; | |
41 | ||
42 | class WXDLLEXPORT wxSocketInputStream : public wxInputStream | |
43 | { | |
44 | public: | |
45 | wxSocketInputStream(wxSocketBase& s); | |
46 | ~wxSocketInputStream(); | |
47 | ||
48 | wxInputStream& Read(void *buffer, size_t size); | |
49 | off_t SeekI( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) ) | |
50 | { return -1; } | |
51 | off_t TellI() | |
52 | { return -1; } | |
53 | ||
54 | protected: | |
55 | wxSocketBase *m_i_socket; | |
56 | ||
57 | size_t OnSysRead(void *buffer, size_t bufsize); | |
58 | }; | |
59 | ||
60 | class WXDLLEXPORT wxSocketStream : public wxSocketInputStream, | |
61 | public wxSocketOutputStream | |
62 | { | |
63 | public: | |
64 | wxSocketStream(wxSocketBase& s); | |
65 | ~wxSocketStream(); | |
66 | }; | |
67 | ||
68 | #endif | |
69 | // wxUSE_SOCKETS && wxUSE_STREAMS | |
70 | ||
71 | #endif | |
72 | // __SCK_STREAM_H__ |