]>
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_lastcount
= m_o_socket
->Write((const char *)buffer
, size
).LastCount();
48 // ---------------------------------------------------------------------------
49 // wxSocketInputStream
50 // ---------------------------------------------------------------------------
52 wxSocketInputStream::wxSocketInputStream(wxSocketBase
& s
)
57 wxSocketInputStream::~wxSocketInputStream()
61 wxInputStream
& wxSocketInputStream::Read(void *buffer
, size_t size
)
63 m_lastcount
= m_i_socket
->Read((char *)buffer
, size
).LastCount();
67 // ---------------------------------------------------------------------------
69 // ---------------------------------------------------------------------------
71 wxSocketStream::wxSocketStream(wxSocketBase
& s
)
72 : wxSocketInputStream(s
), wxSocketOutputStream(s
)
76 wxSocketStream::~wxSocketStream()