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{wxSocketBase
}{wxsocketbase
},
\helpref{wxProtocol
}{wxprotocol
}
23 % ----------------------------------------------------------------------------
25 % ----------------------------------------------------------------------------
27 \latexignore{\rtfignore{\wxheading{Members
}}}
29 \membersection{wxURL::wxURL
}\label{wxurlctor
}
31 \func{}{wxURL
}{\param{const wxString\&
}{ url = wxEmptyString
}}
33 Constructs a URL object from the string. The URL must be valid according
34 to RFC
1738. In particular, file URLs must be of the format
35 {\tt file://hostname/path/to/file
} otherwise
\helpref{GetError
}{wxurlgeterror
}
36 will return a value different from
{\tt wxURL
\_NOERR}.
38 It is valid to leave out the hostname but slashes must remain in place -
39 i.e. a file URL without a hostname must contain three consecutive slashes
40 (e.g.
{\tt file:///somepath/myfile
}).
42 \wxheading{Parameters
}
44 \docparam{url
}{Url string to parse.
}
46 \membersection{wxURL::
\destruct{wxURL
}}\label{wxurldtor
}
48 \func{}{\destruct{wxURL
}}{\void}
50 Destroys the URL object.
55 \membersection{wxURL::GetProtocol
}\label{wxurlgetprotocol
}
57 \func{wxProtocol\&
}{GetProtocol
}{\void}
59 Returns a reference to the protocol which will be used to get the URL.
64 \membersection{wxURL::GetError
}\label{wxurlgeterror
}
66 \constfunc{wxURLError
}{GetError
}{\void}
68 Returns the last error. This error refers to the URL parsing or to the protocol.
69 It can be one of these errors:
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.
}
85 \membersection{wxURL::GetInputStream
}\label{wxurlgetinputstream
}
87 \func{wxInputStream *
}{GetInputStream
}{\void}
89 Creates a new input stream on the specified URL. You can use all but seek
90 functionality of wxStream. Seek isn't available on all streams. For example,
91 HTTP or FTP streams don't deal with it.
93 Note that this method is somewhat depreciated, all future wxWidgets applications
94 should really use
\helpref{wxFileSystem
}{wxfilesystem
} instead.
99 wxURL url("http://a.host/a.dir/a.file");
100 if (url.GetError() == wxURL_NOERR)
102 wxInputStream *in_stream;
104 in_stream = url.GetInputStream();
105 // Then, you can use all IO calls of in_stream (See wxStream)
109 \wxheading{Return value
}
111 Returns the initialized stream. You will have to delete it yourself.
115 \helpref{wxInputStream
}{wxinputstream
}
121 \membersection{wxURL::IsOk
}\label{wxurlgetisok
}
123 \constfunc{bool
}{IsOk
}{\void}
125 Returns
\true if this object is correctly initialized, i.e. if
126 \helpref{GetError
}{wxurlgeterror
} returns
{\tt wxURL
\_NOERR}.
132 \membersection{wxURL::SetDefaultProxy
}\label{wxurlsetdefaultproxy
}
134 \func{static void
}{SetDefaultProxy
}{\param{const wxString\&
}{ url
\_proxy}}
136 Sets the default proxy server to use to get the URL. The string specifies
137 the proxy like this: <hostname>:<port number>.
139 \wxheading{Parameters
}
141 \docparam{url
\_proxy}{Specifies the proxy to use
}
145 \helpref{wxURL::SetProxy
}{wxurlsetproxy
}
150 \membersection{wxURL::SetProxy
}\label{wxurlsetproxy
}
152 \func{void
}{SetProxy
}{\param{const wxString\&
}{ url
\_proxy}}
154 Sets the proxy to use for this URL.
158 \helpref{wxURL::SetDefaultProxy
}{wxurlsetdefaultproxy
}
164 \membersection{wxURL::SetURL
}\label{wxurlseturl
}
166 \func{wxURLError
}{SetURL
}{\param{const wxString\&
}{ url
}}
168 Initializes this object with the given URL and returns
{\tt wxURL
\_NOERR}
169 if it's valid (see
\helpref{GetError
}{wxurlgeterror
} for more info).