]>
Commit | Line | Data |
---|---|---|
f4ada568 GL |
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" | |
ce4169a4 RR |
19 | |
20 | #if wxUSE_SOCKETS && wxUSE_STREAMS | |
21 | ||
f4ada568 GL |
22 | #include "wx/socket.h" |
23 | ||
75ed1d15 | 24 | class WXDLLEXPORT wxSocketOutputStream : public wxOutputStream |
f4ada568 GL |
25 | { |
26 | public: | |
27 | wxSocketOutputStream(wxSocketBase& s); | |
75ed1d15 | 28 | ~wxSocketOutputStream(); |
f4ada568 GL |
29 | |
30 | wxOutputStream& Write(const void *buffer, size_t size); | |
e22036dc RR |
31 | off_t SeekO( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) ) |
32 | { return -1; } | |
33 | off_t TellO() | |
34 | { return -1; } | |
f4ada568 | 35 | |
f4ada568 GL |
36 | protected: |
37 | wxSocketBase *m_o_socket; | |
375abe3d GL |
38 | |
39 | size_t OnSysWrite(const void *buffer, size_t bufsize); | |
f4ada568 GL |
40 | }; |
41 | ||
75ed1d15 | 42 | class WXDLLEXPORT wxSocketInputStream : public wxInputStream |
f4ada568 GL |
43 | { |
44 | public: | |
45 | wxSocketInputStream(wxSocketBase& s); | |
46 | ~wxSocketInputStream(); | |
47 | ||
48 | wxInputStream& Read(void *buffer, size_t size); | |
e22036dc RR |
49 | off_t SeekI( off_t WXUNUSED(pos), wxSeekMode WXUNUSED(mode) ) |
50 | { return -1; } | |
51 | off_t TellI() | |
52 | { return -1; } | |
f4ada568 | 53 | |
f4ada568 GL |
54 | protected: |
55 | wxSocketBase *m_i_socket; | |
375abe3d GL |
56 | |
57 | size_t OnSysRead(void *buffer, size_t bufsize); | |
f4ada568 GL |
58 | }; |
59 | ||
60 | class WXDLLEXPORT wxSocketStream : public wxSocketInputStream, | |
75ed1d15 GL |
61 | public wxSocketOutputStream |
62 | { | |
f4ada568 | 63 | public: |
f4ada568 | 64 | wxSocketStream(wxSocketBase& s); |
75ed1d15 | 65 | ~wxSocketStream(); |
f4ada568 GL |
66 | }; |
67 | ||
68 | #endif | |
ce4169a4 RR |
69 | // wxUSE_SOCKETS && wxUSE_STREAMS |
70 | ||
71 | #endif | |
72 | // __SCK_STREAM_H__ |