ObjFW  Diff

Differences From Artifact [5d05ef422c]:

To Artifact [a3a984e369]:


13
14
15
16
17
18
19


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39


40
41
42
43



44
45
46
47
48
49
50
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39


40
41
42



43
44
45
46
47
48
49
50
51
52







+
+


















-
-
+
+

-
-
-
+
+
+







 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"
#import "OFSerialization.h"

OF_ASSUME_NONNULL_BEGIN

@class OFString;

/*!
 * @class OFURL OFURL.h ObjFW/OFURL.h
 *
 * @brief A class for parsing URLs and accessing parts of it.
 */
@interface OFURL: OFObject <OFCopying, OFSerialization>
{
	OFString *_scheme, *_host;
	uint16_t _port;
	OFString *_user, *_password, *_path, *_parameters, *_query, *_fragment;
}

#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *scheme;
@property (copy) OFString *host;
@property uint16_t port;
@property (copy) OFString *user;
@property (copy) OFString *password;
@property (copy, nullable) OFString *user;
@property (copy, nullable) OFString *password;
@property (copy) OFString *path;
@property (copy) OFString *parameters;
@property (copy) OFString *query;
@property (copy) OFString *fragment;
@property (copy, nullable) OFString *parameters;
@property (copy, nullable) OFString *query;
@property (copy, nullable) OFString *fragment;
#endif

/*!
 * Creates a new URL.
 *
 * @return A new, autoreleased OFURL
 */
130
131
132
133
134
135
136
137

138
139
140
141
142
143
144

145
146
147
148
149
150
151

152
153
154
155
156
157
158

159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179

180
181
182
183
184
185
186

187
188
189
190
191
192
193

194
195
196
197
198
199
200

201
202
203
204
205
206
207

208
209
210
211
212
213
214

215
216
217
218
219
220
221
222


132
133
134
135
136
137
138

139
140
141
142
143
144
145

146
147
148
149
150
151
152

153
154
155
156
157
158
159

160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180

181
182
183
184
185
186
187

188
189
190
191
192
193
194

195
196
197
198
199
200
201

202
203
204
205
206
207
208

209
210
211
212
213
214
215

216
217
218
219
220
221
222
223
224
225
226







-
+






-
+






-
+






-
+




















-
+






-
+






-
+






-
+






-
+






-
+








+
+
- (void)setPort: (uint16_t)port;

/*!
 * @brief Returns the user part of the URL.
 *
 * @return The user part of the URL
 */
- (OFString*)user;
- (nullable OFString*)user;

/*!
 * @brief Set the user part of the URL.
 *
 * @param user The user part of the URL to set
 */
- (void)setUser: (OFString*)user;
- (void)setUser: (nullable OFString*)user;

/*!
 * @brief Returns the password part of the URL.
 *
 * @return The password part of the URL
 */
- (OFString*)password;
- (nullable OFString*)password;

/*!
 * @brief Set the password part of the URL.
 *
 * @param password The password part of the URL to set
 */
- (void)setPassword: (OFString*)password;
- (void)setPassword: (nullable OFString*)password;

/*!
 * @brief Returns the path part of the URL.
 *
 * @return The path part of the URL
 */
- (OFString*)path;

/*!
 * @brief Set the path part of the URL.
 *
 * @param path The path part of the URL to set
 */
- (void)setPath: (OFString*)path;

/*!
 * @brief Returns the parameters part of the URL.
 *
 * @return The parameters part of the URL
 */
- (OFString*)parameters;
- (nullable OFString*)parameters;

/*!
 * @brief Set the parameters part of the URL.
 *
 * @param parameters The parameters part of the URL to set
 */
- (void)setParameters: (OFString*)parameters;
- (void)setParameters: (nullable OFString*)parameters;

/*!
 * @brief Returns the query part of the URL.
 *
 * @return The query part of the URL
 */
- (OFString*)query;
- (nullable OFString*)query;

/*!
 * @brief Set the query part of the URL.
 *
 * @param query The query part of the URL to set
 */
- (void)setQuery: (OFString*)query;
- (void)setQuery: (nullable OFString*)query;

/*!
 * @brief Returns the fragment part of the URL.
 *
 * @return The fragment part of the URL
 */
- (OFString*)fragment;
- (nullable OFString*)fragment;

/*!
 * @brief Set the fragment part of the URL.
 *
 * @param fragment The fragment part of the URL to set
 */
- (void)setFragment: (OFString*)fragment;
- (void)setFragment: (nullable OFString*)fragment;

/*!
 * @brief Returns the URL as a string.
 *
 * @return The URL as a string
 */
- (OFString*)string;
@end

OF_ASSUME_NONNULL_END