]>
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 | #ifdef __GNUG__ | |
12 | #pragma implementation "sckstrm.h" | |
13 | #endif | |
14 | ||
fcc6dddd JS |
15 | // For compilers that support precompilation, includes "wx.h". |
16 | #include "wx/wxprec.h" | |
17 | ||
18 | #ifdef __BORLANDC__ | |
19 | #pragma hdrstop | |
20 | #endif | |
21 | ||
22 | #ifndef WX_PRECOMP | |
23 | #endif | |
24 | ||
f4ada568 GL |
25 | #include "wx/stream.h" |
26 | #include "wx/socket.h" | |
27 | #include "wx/sckstrm.h" | |
28 | ||
29 | // --------------------------------------------------------------------------- | |
30 | // wxSocketOutputStream | |
31 | // --------------------------------------------------------------------------- | |
32 | ||
33 | wxSocketOutputStream::wxSocketOutputStream(wxSocketBase& s) | |
34 | : m_o_socket(&s) | |
35 | { | |
36 | } | |
37 | ||
38 | wxSocketOutputStream::~wxSocketOutputStream() | |
39 | { | |
40 | } | |
41 | ||
42 | wxOutputStream& wxSocketOutputStream::Write(const void *buffer, size_t size) | |
43 | { | |
75ed1d15 | 44 | m_lastcount = m_o_socket->Write((const char *)buffer, size).LastCount(); |
f4ada568 GL |
45 | return *this; |
46 | } | |
47 | ||
48 | // --------------------------------------------------------------------------- | |
49 | // wxSocketInputStream | |
50 | // --------------------------------------------------------------------------- | |
51 | ||
52 | wxSocketInputStream::wxSocketInputStream(wxSocketBase& s) | |
53 | : m_i_socket(&s) | |
54 | { | |
55 | } | |
56 | ||
57 | wxSocketInputStream::~wxSocketInputStream() | |
58 | { | |
59 | } | |
60 | ||
61 | wxInputStream& wxSocketInputStream::Read(void *buffer, size_t size) | |
62 | { | |
75ed1d15 | 63 | m_lastcount = m_i_socket->Read((char *)buffer, size).LastCount(); |
f4ada568 GL |
64 | return *this; |
65 | } | |
66 | ||
67 | // --------------------------------------------------------------------------- | |
75ed1d15 | 68 | // wxSocketStream |
f4ada568 | 69 | // --------------------------------------------------------------------------- |
f4ada568 GL |
70 | |
71 | wxSocketStream::wxSocketStream(wxSocketBase& s) | |
72 | : wxSocketInputStream(s), wxSocketOutputStream(s) | |
73 | { | |
74 | } | |
75ed1d15 GL |
75 | |
76 | wxSocketStream::~wxSocketStream() | |
77 | { | |
78 | } |