]>
Commit | Line | Data |
---|---|---|
1 | \section{\class{wxURL}}\label{wxurl} | |
2 | ||
3 | \wxheading{Derived from} | |
4 | ||
5 | \helpref{wxObject}{wxobject} | |
6 | ||
7 | \wxheading{Include files} | |
8 | ||
9 | <wx/url.h> | |
10 | ||
11 | \wxheading{See also} | |
12 | ||
13 | \helpref{wxSocketBase}{wxsocketbase}, \helpref{wxProtocol}{wxprotocol} | |
14 | ||
15 | \wxheading{Example} | |
16 | ||
17 | \begin{verbatim} | |
18 | wxURL url("http://a.host/a.dir/a.file"); | |
19 | wxInputStream *in_stream; | |
20 | ||
21 | in_stream = url.GetInputStream(); | |
22 | // Then, you can use all IO calls of in_stream (See wxStream) | |
23 | \end{verbatim} | |
24 | ||
25 | % ---------------------------------------------------------------------------- | |
26 | % Members | |
27 | % ---------------------------------------------------------------------------- | |
28 | ||
29 | \latexignore{\rtfignore{\wxheading{Members}}} | |
30 | ||
31 | \membersection{wxURL::wxURL}\label{wxurlctor} | |
32 | ||
33 | \func{}{wxURL}{\param{const wxString\&}{ url}} | |
34 | ||
35 | Constructs a URL object from the string. The URL must be valid according | |
36 | to RFC 1738. In particular, file URLs must be of the format | |
37 | 'file://hostname/path/to/file'. It is valid to leave out the hostname | |
38 | but slashes must remain in place-- i.e. a file URL without a hostname must | |
39 | contain three consecutive slashes. | |
40 | ||
41 | \wxheading{Parameters} | |
42 | ||
43 | \docparam{url}{Url string to parse.} | |
44 | ||
45 | \membersection{wxURL::\destruct{wxURL}}\label{wxurldtor} | |
46 | ||
47 | \func{}{\destruct{wxURL}}{\void} | |
48 | ||
49 | Destroys the URL object. | |
50 | ||
51 | % | |
52 | % GetProtocolName | |
53 | % | |
54 | \membersection{wxURL::GetProtocolName}\label{wxurlgetprotocolname} | |
55 | ||
56 | \constfunc{wxString}{GetProtocolName}{\void} | |
57 | ||
58 | Returns the name of the protocol which will be used to get the URL. | |
59 | ||
60 | % | |
61 | % GetProtocol | |
62 | % | |
63 | \membersection{wxURL::GetProtocol}\label{wxurlgetprotocol} | |
64 | ||
65 | \func{wxProtocol\&}{GetProtocol}{\void} | |
66 | ||
67 | Returns a reference to the protocol which will be used to get the URL. | |
68 | ||
69 | % | |
70 | % GetPath | |
71 | % | |
72 | \membersection{wxURL::GetPath}\label{wxurlgetpath} | |
73 | ||
74 | \func{wxString}{GetPath}{\void} | |
75 | ||
76 | Returns the path of the file to fetch. This path was encoded in the URL. | |
77 | ||
78 | % | |
79 | % GetError | |
80 | % | |
81 | \membersection{wxURL::GetError}\label{wxurlgeterror} | |
82 | ||
83 | \constfunc{wxURLError}{GetError}{\void} | |
84 | ||
85 | Returns the last error. This error refers to the URL parsing or to the protocol. | |
86 | It can be one of these errors: | |
87 | ||
88 | \twocolwidtha{7cm} | |
89 | \begin{twocollist}\itemsep=0pt% | |
90 | \twocolitem{{\bf wxURL\_NOERR}}{No error.} | |
91 | \twocolitem{{\bf wxURL\_SNTXERR}}{Syntax error in the URL string.} | |
92 | \twocolitem{{\bf wxURL\_NOPROTO}}{Found no protocol which can get this URL.} | |
93 | \twocolitem{{\bf wxURL\_NOHOST}}{An host name is required for this protocol.} | |
94 | \twocolitem{{\bf wxURL\_NOPATH}}{A path is required for this protocol.} | |
95 | \twocolitem{{\bf wxURL\_CONNERR}}{Connection error.} | |
96 | \twocolitem{{\bf wxURL\_PROTOERR}}{An error occurred during negotiation.} | |
97 | \end{twocollist}% | |
98 | ||
99 | % | |
100 | % GetInputStream | |
101 | % | |
102 | \membersection{wxURL::GetInputStream}\label{wxurlgetinputstream} | |
103 | ||
104 | \func{wxInputStream *}{GetInputStream}{\void} | |
105 | ||
106 | Creates a new input stream on the the specified URL. You can use all but seek | |
107 | functionality of wxStream. Seek isn't available on all stream. For example, | |
108 | http or ftp streams doesn't deal with it. | |
109 | ||
110 | \wxheading{Return value} | |
111 | ||
112 | Returns the initialized stream. You will have to delete it yourself. | |
113 | ||
114 | \wxheading{See also} | |
115 | ||
116 | \helpref{wxInputStream}{wxinputstream} | |
117 | ||
118 | % | |
119 | % SetDefaultProxy | |
120 | % | |
121 | \membersection{wxURL::SetDefaultProxy}\label{wxurlsetdefaultproxy} | |
122 | ||
123 | \func{static void}{SetDefaultProxy}{\param{const wxString\&}{ url\_proxy}} | |
124 | ||
125 | Sets the default proxy server to use to get the URL. The string specifies | |
126 | the proxy like this: <hostname>:<port number>. | |
127 | ||
128 | \wxheading{Parameters} | |
129 | ||
130 | \docparam{url\_proxy}{Specifies the proxy to use} | |
131 | ||
132 | \wxheading{See also} | |
133 | ||
134 | \helpref{wxURL::SetProxy}{wxurlsetproxy} | |
135 | ||
136 | % | |
137 | % SetProxy | |
138 | % | |
139 | \membersection{wxURL::SetProxy}\label{wxurlsetproxy} | |
140 | ||
141 | \func{void}{SetProxy}{\param{const wxString\&}{ url\_proxy}} | |
142 | ||
143 | Sets the proxy to use for this URL. | |
144 | ||
145 | \wxheading{See also} | |
146 | ||
147 | \helpref{wxURL::SetDefaultProxy}{wxurlsetdefaultproxy} | |
148 | ||
149 | % | |
150 | % SetProxy | |
151 | % | |
152 | \membersection{wxURL::ConvertToValidURI}\label{wxurlconverttovaliduri} | |
153 | ||
154 | \func{static wxString}{ConvertToValidURI}{\param{const wxString\&}{ uri}} | |
155 | ||
156 | It converts a non-standardized URI to a valid network URI. It encodes non | |
157 | standard characters. | |
158 |