ObjFW
OFURL.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
3  * Jonathan Schleifer <js@webkeks.org>
4  *
5  * All rights reserved.
6  *
7  * This file is part of ObjFW. It may be distributed under the terms of the
8  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
9  * the packaging of this file.
10  *
11  * Alternatively, it may be distributed under the terms of the GNU General
12  * Public License, either version 2 or 3, which can be found in the file
13  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
14  * file.
15  */
16 
17 #import "OFObject.h"
18 #import "OFSerialization.h"
19 
20 OF_ASSUME_NONNULL_BEGIN
21 
22 @class OFString;
23 
30 {
31  OFString *_scheme, *_host;
32  uint16_t _port;
33  OFString *_user, *_password, *_path, *_parameters, *_query, *_fragment;
34 }
35 
36 #ifdef OF_HAVE_PROPERTIES
37 @property (copy) OFString *scheme, *host;
38 @property uint16_t port;
39 @property OF_NULLABLE_PROPERTY (copy) OFString *user, *password;
40 @property (copy) OFString *path;
41 @property OF_NULLABLE_PROPERTY (copy) OFString *parameters, *query, *fragment;
42 #endif
43 
49 + (instancetype)URL;
50 
57 + (instancetype)URLWithString: (OFString*)string;
58 
66 + (instancetype)URLWithString: (OFString*)string
67  relativeToURL: (OFURL*)URL;
68 
75 - initWithString: (OFString*)string;
76 
85 - initWithString: (OFString*)string
86  relativeToURL: (OFURL*)URL;
87 
93 - (OFString*)scheme;
94 
100 - (void)setScheme: (OFString*)scheme;
101 
107 - (OFString*)host;
108 
114 - (void)setHost: (OFString*)host;
115 
121 - (uint16_t)port;
122 
128 - (void)setPort: (uint16_t)port;
129 
135 - (nullable OFString*)user;
136 
142 - (void)setUser: (nullable OFString*)user;
143 
149 - (nullable OFString*)password;
150 
156 - (void)setPassword: (nullable OFString*)password;
157 
163 - (OFString*)path;
164 
170 - (void)setPath: (OFString*)path;
171 
177 - (nullable OFString*)parameters;
178 
184 - (void)setParameters: (nullable OFString*)parameters;
185 
191 - (nullable OFString*)query;
192 
198 - (void)setQuery: (nullable OFString*)query;
199 
205 - (nullable OFString*)fragment;
206 
212 - (void)setFragment: (nullable OFString*)fragment;
213 
219 - (OFString*)string;
220 @end
221 
222 OF_ASSUME_NONNULL_END
A protocol for serializing objects.
Definition: OFSerialization.h:30
The root class for all other classes inside ObjFW.
Definition: OFObject.h:364
A class for handling strings.
Definition: OFString.h:91
A protocol for the creation of copies.
Definition: OFObject.h:896
A class for parsing URLs and accessing parts of it.
Definition: OFURL.h:29