]>
git.saurik.com Git - wxWidgets.git/blob - src/common/sckstrm.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSocket*Stream
4 // Author: Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "sckstrm.h"
15 // For compilers that support precompilation, includes "wx.h".
16 #include "wx/wxprec.h"
25 #include "wx/stream.h"
26 #include "wx/socket.h"
27 #include "wx/sckstrm.h"
29 // ---------------------------------------------------------------------------
30 // wxSocketOutputStream
31 // ---------------------------------------------------------------------------
33 wxSocketOutputStream::wxSocketOutputStream(wxSocketBase
& s
)
38 wxSocketOutputStream::~wxSocketOutputStream()
42 wxOutputStream
& wxSocketOutputStream::Write(const void *buffer
, size_t size
)
44 m_o_socket
->Write((const char *)buffer
, size
);
48 // ---------------------------------------------------------------------------
49 // wxSocketInputStream
50 // ---------------------------------------------------------------------------
52 wxSocketInputStream::wxSocketInputStream(wxSocketBase
& s
)
57 wxSocketInputStream::~wxSocketInputStream()
61 wxInputStream
& wxSocketInputStream::Read(void *buffer
, size_t size
)
63 m_i_socket
->Read((char *)buffer
, size
);
67 // ---------------------------------------------------------------------------
68 // wxSocketStream (IO)
69 // ---------------------------------------------------------------------------
70 wxSocketStream::wxSocketStream(wxSocketBase
& i_s
, wxSocketBase
& o_s
)
71 : wxSocketInputStream(i_s
), wxSocketOutputStream(o_s
)
75 wxSocketStream::wxSocketStream(wxSocketBase
& s
)
76 : wxSocketInputStream(s
), wxSocketOutputStream(s
)