]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/url.tex
Always draw the selection of selected items, not just when they have
[wxWidgets.git] / docs / latex / wx / url.tex
... / ...
CommitLineData
1\section{\class{wxURL}}\label{wxurl}
2
3wxURL is a specialization of \helpref{wxURI}{wxuri} for parsing URLs.
4Please look at \helpref{wxURI}{wxuri} documentation for more info about the functions
5you can use to retrieve the various parts of the URL (scheme, server, port, etc).
6
7Supports standard assignment operators, copy constructors,
8and comparison operators.
9
10\wxheading{Derived from}
11
12\helpref{wxURI}{wxuri}\\
13\helpref{wxObject}{wxobject}
14
15\wxheading{Include files}
16
17<wx/url.h>
18
19\wxheading{See also}
20
21\helpref{wxSocketBase}{wxsocketbase}, \helpref{wxProtocol}{wxprotocol}
22
23% ----------------------------------------------------------------------------
24% Members
25% ----------------------------------------------------------------------------
26
27\latexignore{\rtfignore{\wxheading{Members}}}
28
29\membersection{wxURL::wxURL}\label{wxurlctor}
30
31\func{}{wxURL}{\param{const wxString\&}{ url = wxEmptyString}}
32
33Constructs a URL object from the string. The URL must be valid according
34to RFC 1738. In particular, file URLs must be of the format
35{\tt file://hostname/path/to/file} otherwise \helpref{GetError}{wxurlgeterror}
36will return a value different from {\tt wxURL\_NOERR}.
37
38It is valid to leave out the hostname but slashes must remain in place -
39i.e. a file URL without a hostname must contain three consecutive slashes
40(e.g. {\tt file:///somepath/myfile}).
41
42\wxheading{Parameters}
43
44\docparam{url}{Url string to parse.}
45
46\membersection{wxURL::\destruct{wxURL}}\label{wxurldtor}
47
48\func{}{\destruct{wxURL}}{\void}
49
50Destroys the URL object.
51
52%
53% GetProtocol
54%
55\membersection{wxURL::GetProtocol}\label{wxurlgetprotocol}
56
57\func{wxProtocol\&}{GetProtocol}{\void}
58
59Returns a reference to the protocol which will be used to get the URL.
60
61%
62% GetError
63%
64\membersection{wxURL::GetError}\label{wxurlgeterror}
65
66\constfunc{wxURLError}{GetError}{\void}
67
68Returns the last error. This error refers to the URL parsing or to the protocol.
69It can be one of these errors:
70
71\twocolwidtha{7cm}
72\begin{twocollist}\itemsep=0pt%
73\twocolitem{{\bf wxURL\_NOERR}}{No error.}
74\twocolitem{{\bf wxURL\_SNTXERR}}{Syntax error in the URL string.}
75\twocolitem{{\bf wxURL\_NOPROTO}}{Found no protocol which can get this URL.}
76\twocolitem{{\bf wxURL\_NOHOST}}{An host name is required for this protocol.}
77\twocolitem{{\bf wxURL\_NOPATH}}{A path is required for this protocol.}
78\twocolitem{{\bf wxURL\_CONNERR}}{Connection error.}
79\twocolitem{{\bf wxURL\_PROTOERR}}{An error occurred during negotiation.}
80\end{twocollist}%
81
82%
83% GetInputStream
84%
85\membersection{wxURL::GetInputStream}\label{wxurlgetinputstream}
86
87\func{wxInputStream *}{GetInputStream}{\void}
88
89Creates a new input stream on the specified URL. You can use all but seek
90functionality of wxStream. Seek isn't available on all streams. For example,
91HTTP or FTP streams don't deal with it.
92
93Note that this method is somewhat depreciated, all future wxWidgets applications
94should really use \helpref{wxFileSystem}{wxfilesystem} instead.
95
96Example:
97
98\begin{verbatim}
99 wxURL url("http://a.host/a.dir/a.file");
100 if (url.GetError() == wxURL_NOERR)
101 {
102 wxInputStream *in_stream;
103
104 in_stream = url.GetInputStream();
105 // Then, you can use all IO calls of in_stream (See wxStream)
106 }
107\end{verbatim}
108
109\wxheading{Return value}
110
111Returns the initialized stream. You will have to delete it yourself.
112
113\wxheading{See also}
114
115\helpref{wxInputStream}{wxinputstream}
116
117
118%
119% IsOk
120%
121\membersection{wxURL::IsOk}\label{wxurlgetisok}
122
123\constfunc{bool}{IsOk}{\void}
124
125Returns \true if this object is correctly initialized, i.e. if
126\helpref{GetError}{wxurlgeterror} returns {\tt wxURL\_NOERR}.
127
128
129%
130% SetDefaultProxy
131%
132\membersection{wxURL::SetDefaultProxy}\label{wxurlsetdefaultproxy}
133
134\func{static void}{SetDefaultProxy}{\param{const wxString\&}{ url\_proxy}}
135
136Sets the default proxy server to use to get the URL. The string specifies
137the proxy like this: <hostname>:<port number>.
138
139\wxheading{Parameters}
140
141\docparam{url\_proxy}{Specifies the proxy to use}
142
143\wxheading{See also}
144
145\helpref{wxURL::SetProxy}{wxurlsetproxy}
146
147%
148% SetProxy
149%
150\membersection{wxURL::SetProxy}\label{wxurlsetproxy}
151
152\func{void}{SetProxy}{\param{const wxString\&}{ url\_proxy}}
153
154Sets the proxy to use for this URL.
155
156\wxheading{See also}
157
158\helpref{wxURL::SetDefaultProxy}{wxurlsetdefaultproxy}
159
160
161%
162% SetURL
163%
164\membersection{wxURL::SetURL}\label{wxurlseturl}
165
166\func{wxURLError}{SetURL}{\param{const wxString\&}{ url}}
167
168Initializes this object with the given URL and returns {\tt wxURL\_NOERR}
169if it's valid (see \helpref{GetError}{wxurlgeterror} for more info).
170