1 \section{\class{wxURL
}}\label{wxurl
}
3 wxURL is a specialization of
\helpref{wxURI
}{wxuri
} for parsing URLs.
4 Please look at
\helpref{wxURI
}{wxuri
} documentation for more info about the functions
5 you can use to retrieve the various parts of the URL (scheme, server, port, etc).
7 Supports standard assignment operators, copy constructors,
8 and comparison operators.
10 \wxheading{Derived from
}
12 \helpref{wxURI
}{wxuri
}\\
13 \helpref{wxObject
}{wxobject
}
15 \wxheading{Include files
}
21 \helpref{wxNet
}{librarieslist
}
25 \helpref{wxSocketBase
}{wxsocketbase
},
\helpref{wxProtocol
}{wxprotocol
}
27 % ----------------------------------------------------------------------------
29 % ----------------------------------------------------------------------------
31 \latexignore{\rtfignore{\wxheading{Members
}}}
33 \membersection{wxURL::wxURL
}\label{wxurlctor
}
35 \func{}{wxURL
}{\param{const wxString\&
}{ url = wxEmptyString
}}
37 Constructs a URL object from the string. The URL must be valid according
38 to RFC
1738. In particular, file URLs must be of the format
39 {\tt file://hostname/path/to/file
} otherwise
\helpref{GetError
}{wxurlgeterror
}
40 will return a value different from
{\tt wxURL
\_NOERR}.
42 It is valid to leave out the hostname but slashes must remain in place -
43 i.e. a file URL without a hostname must contain three consecutive slashes
44 (e.g.
{\tt file:///somepath/myfile
}).
46 \wxheading{Parameters
}
48 \docparam{url
}{Url string to parse.
}
50 \membersection{wxURL::
\destruct{wxURL
}}\label{wxurldtor
}
52 \func{}{\destruct{wxURL
}}{\void}
54 Destroys the URL object.
59 \membersection{wxURL::GetProtocol
}\label{wxurlgetprotocol
}
61 \func{wxProtocol\&
}{GetProtocol
}{\void}
63 Returns a reference to the protocol which will be used to get the URL.
68 \membersection{wxURL::GetError
}\label{wxurlgeterror
}
70 \constfunc{wxURLError
}{GetError
}{\void}
72 Returns the last error. This error refers to the URL parsing or to the protocol.
73 It can be one of these errors:
76 \begin{twocollist
}\itemsep=
0pt
%
77 \twocolitem{{\bf wxURL
\_NOERR}}{No error.
}
78 \twocolitem{{\bf wxURL
\_SNTXERR}}{Syntax error in the URL string.
}
79 \twocolitem{{\bf wxURL
\_NOPROTO}}{Found no protocol which can get this URL.
}
80 \twocolitem{{\bf wxURL
\_NOHOST}}{A host name is required for this protocol.
}
81 \twocolitem{{\bf wxURL
\_NOPATH}}{A path is required for this protocol.
}
82 \twocolitem{{\bf wxURL
\_CONNERR}}{Connection error.
}
83 \twocolitem{{\bf wxURL
\_PROTOERR}}{An error occurred during negotiation.
}
89 \membersection{wxURL::GetInputStream
}\label{wxurlgetinputstream
}
91 \func{wxInputStream *
}{GetInputStream
}{\void}
93 Creates a new input stream on the specified URL. You can use all but seek
94 functionality of wxStream. Seek isn't available on all streams. For example,
95 HTTP or FTP streams don't deal with it.
97 Note that this method is somewhat deprecated, all future wxWidgets applications
98 should really use
\helpref{wxFileSystem
}{wxfilesystem
} instead.
103 wxURL url("http://a.host/a.dir/a.file");
104 if (url.GetError() == wxURL_NOERR)
106 wxInputStream *in_stream;
108 in_stream = url.GetInputStream();
109 // Then, you can use all IO calls of in_stream (See wxStream)
113 \wxheading{Return value
}
115 Returns the initialized stream. You will have to delete it yourself.
119 \helpref{wxInputStream
}{wxinputstream
}
125 \membersection{wxURL::IsOk
}\label{wxurlgetisok
}
127 \constfunc{bool
}{IsOk
}{\void}
129 Returns
\true if this object is correctly initialized, i.e. if
130 \helpref{GetError
}{wxurlgeterror
} returns
{\tt wxURL
\_NOERR}.
136 \membersection{wxURL::SetDefaultProxy
}\label{wxurlsetdefaultproxy
}
138 \func{static void
}{SetDefaultProxy
}{\param{const wxString\&
}{ url
\_proxy}}
140 Sets the default proxy server to use to get the URL. The string specifies
141 the proxy like this: <hostname>:<port number>.
143 \wxheading{Parameters
}
145 \docparam{url
\_proxy}{Specifies the proxy to use
}
149 \helpref{wxURL::SetProxy
}{wxurlsetproxy
}
154 \membersection{wxURL::SetProxy
}\label{wxurlsetproxy
}
156 \func{void
}{SetProxy
}{\param{const wxString\&
}{ url
\_proxy}}
158 Sets the proxy to use for this URL.
162 \helpref{wxURL::SetDefaultProxy
}{wxurlsetdefaultproxy
}
168 \membersection{wxURL::SetURL
}\label{wxurlseturl
}
170 \func{wxURLError
}{SetURL
}{\param{const wxString\&
}{ url
}}
172 Initializes this object with the given URL and returns
{\tt wxURL
\_NOERR}
173 if it's valid (see
\helpref{GetError
}{wxurlgeterror
} for more info).