#include </home/zeitlin/src/wx/github/interface/wx/protocol/protocol.h>
Represents a protocol for use with wxURL.
Note that you may want to change the default time-out for HTTP/FTP connections and network operations (using SetDefaultTimeout()) since the default time-out value is quite long (60 seconds).
Public Member Functions | |
virtual bool | Abort ()=0 |
Abort the current stream. | |
virtual wxString | GetContentType () const |
Returns the type of the content of the last opened stream. | |
virtual wxProtocolError | GetError () const |
Returns the last occurred error. | |
virtual wxInputStream * | GetInputStream (const wxString &path)=0 |
Creates a new input stream on the specified path. | |
bool | Reconnect () |
Tries to reestablish a previous opened connection (close and renegotiate connection). | |
virtual void | SetPassword (const wxString &user) |
Sets the authentication password. | |
virtual void | SetUser (const wxString &user) |
Sets the authentication user. | |
void | SetDefaultTimeout (wxUint32 Value) |
Sets a new default timeout for the network operations. | |
Logging support. | |
Each wxProtocol object may have the associated logger (by default there is none) which is used to log network requests and responses. | |
void | SetLog (wxProtocolLog *log) |
Set the logger, deleting the old one and taking ownership of this one. | |
wxProtocolLog * | GetLog () const |
Return the current logger, may be NULL. | |
wxProtocolLog * | DetachLog () |
Detach the existing logger without deleting it. | |
void | LogRequest (const wxString &str) |
Call wxProtocolLog::LogRequest() if we have a valid logger or do nothing otherwise. | |
void | LogResponse (const wxString &str) |
Call wxProtocolLog::LogResponse() if we have a valid logger or do nothing otherwise. |
virtual bool wxProtocol::Abort | ( | ) | [pure virtual] |
Abort the current stream.
Implemented in wxFTP.
wxProtocolLog* wxProtocol::DetachLog | ( | ) |
Detach the existing logger without deleting it.
The caller is responsible for deleting the returned pointer if it's non-NULL
.
virtual wxString wxProtocol::GetContentType | ( | ) | const [virtual] |
Returns the type of the content of the last opened stream.
It is a mime-type. May be an empty string if the content-type is unknown.
virtual wxProtocolError wxProtocol::GetError | ( | ) | const [virtual] |
Returns the last occurred error.
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.
wxProtocolLog* wxProtocol::GetLog | ( | ) | const [inline] |
Return the current logger, may be NULL.
void wxProtocol::LogRequest | ( | const wxString & | str | ) |
Call wxProtocolLog::LogRequest() if we have a valid logger or do nothing otherwise.
void wxProtocol::LogResponse | ( | const wxString & | str | ) |
Call wxProtocolLog::LogResponse() if we have a valid logger or do nothing otherwise.
bool wxProtocol::Reconnect | ( | ) |
Tries to reestablish a previous opened connection (close and renegotiate connection).
void wxProtocol::SetDefaultTimeout | ( | wxUint32 | Value | ) |
Sets a new default timeout for the network operations.
The default timeout is 60 seconds.
void wxProtocol::SetLog | ( | wxProtocolLog * | log | ) |
Set the logger, deleting the old one and taking ownership of this one.
log | New logger allocated on the heap or NULL. |
virtual void wxProtocol::SetPassword | ( | const wxString & | user | ) | [virtual] |
Sets the authentication password.
Reimplemented in wxFTP.