wxProtocol Class Reference
[Networking]

#include <wx/protocol/protocol.h>

Inheritance diagram for wxProtocol:

wxSocketClient wxSocketBase wxObject wxFTP wxHTTP

List of all members.


Detailed Description

Represents a protocol for use with wxURL.

Library:  wxNet

Category:  Networking

See also:
wxSocketBase, wxURL

Public Member Functions

virtual bool Abort ()=0
virtual wxString GetContentType ()
virtual wxProtocolError GetError ()=0
virtual wxInputStreamGetInputStream (const wxString &path)=0
bool Reconnect ()
virtual void SetPassword (const wxString &user)
virtual void SetUser (const wxString &user)

Member Function Documentation

virtual bool wxProtocol::Abort (  )  [pure virtual]

Abort the current stream.

Warning:
It is advised to destroy the input stream instead of aborting the stream this way.
Returns:
Returns true, if successful, else false.

Implemented in wxFTP.

virtual wxString wxProtocol::GetContentType (  )  [virtual]

Returns the type of the content of the last opened stream. It is a mime-type.

virtual wxProtocolError wxProtocol::GetError (  )  [pure virtual]

Returns the last occurred error.

See also:
wxProtocolError

virtual wxInputStream* wxProtocol::GetInputStream ( const wxString path  )  [pure virtual]

Creates a new input stream on the specified path.

You can use all but seek() functionality of wxStream. Seek() isn't available on all streams. For example, HTTP or FTP streams don't deal with it. Other functions like StreamSize() and Tell() aren't available for the moment for this sort of stream. You will be notified when the EOF is reached by an error.

Returns:
Returns the initialized stream. You will have to delete it yourself once you don't use it anymore. The destructor closes the network connection.
See also:
wxInputStream

Implemented in wxFTP, and wxHTTP.

bool wxProtocol::Reconnect (  ) 

Tries to reestablish a previous opened connection (close and renegotiate connection).

Returns:
true, if the connection is established, else false.

virtual void wxProtocol::SetPassword ( const wxString user  )  [virtual]

Sets the authentication password. It is mainly useful when FTP is used.

Reimplemented in wxFTP.

virtual void wxProtocol::SetUser ( const wxString user  )  [virtual]

Sets the authentication user. It is mainly useful when FTP is used.

Reimplemented in wxFTP.



wxWidgets logo

[ top ]