]>
git.saurik.com Git - wxWidgets.git/blob - interface/url.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxURL
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 wxURL is a specialization of wxURI for parsing URLs.
14 Please look at wxURI documentation for more info about the functions
15 you can use to retrieve the various parts of the URL (scheme, server, port,
18 Supports standard assignment operators, copy constructors,
19 and comparison operators.
24 @see wxSocketBase, wxProtocol
26 class wxURL
: public wxURI
30 Constructs a URL object from the string. The URL must be valid according
31 to RFC 1738. In particular, file URLs must be of the format
32 @c file://hostname/path/to/file otherwise GetError()
33 will return a value different from @c wxURL_NOERR.
34 It is valid to leave out the hostname but slashes must remain in place -
35 i.e. a file URL without a hostname must contain three consecutive slashes
36 (e.g. @c file:///somepath/myfile).
41 wxURL(const wxString
& url
= wxEmptyString
);
44 Destroys the URL object.
49 Returns the last error. This error refers to the URL parsing or to the protocol.
50 It can be one of these errors:
58 Syntax error in the URL string.
62 Found no protocol which can get this URL.
66 A host name is required for this protocol.
70 A path is required for this protocol.
78 An error occurred during negotiation.
80 wxURLError
GetError() const;
83 Creates a new input stream on the specified URL. You can use all but seek
84 functionality of wxStream. Seek isn't available on all streams. For example,
85 HTTP or FTP streams don't deal with it.
86 Note that this method is somewhat deprecated, all future wxWidgets applications
87 should really use wxFileSystem instead.
90 @returns Returns the initialized stream. You will have to delete it
95 wxInputStream
* GetInputStream();
98 Returns a reference to the protocol which will be used to get the URL.
100 wxProtocol
GetProtocol();
103 Returns @true if this object is correctly initialized, i.e. if
104 GetError() returns @c wxURL_NOERR.
109 Sets the default proxy server to use to get the URL. The string specifies
110 the proxy like this: hostname:port number.
113 Specifies the proxy to use
117 static void SetDefaultProxy(const wxString
& url_proxy
);
120 Sets the proxy to use for this URL.
122 @see SetDefaultProxy()
124 void SetProxy(const wxString
& url_proxy
);
127 Initializes this object with the given URL and returns @c wxURL_NOERR
128 if it's valid (see GetError() for more info).
130 wxURLError
SetURL(const wxString
& url
);