ObjFW  Diff

Differences From Artifact [23c8849a02]:

To Artifact [ed2d442f57]:


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 */

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

@class OFString;

/**
 * \brief A class for parsing URLs and accessing parts of it.
 */
@interface OFURL: OFObject <OFCopying, OFSerialization>
{
	OFString *scheme;
	OFString *host;
	uint16_t port;
	OFString *user;







|
|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 */

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

@class OFString;

/*!
 * @brief A class for parsing URLs and accessing parts of it.
 */
@interface OFURL: OFObject <OFCopying, OFSerialization>
{
	OFString *scheme;
	OFString *host;
	uint16_t port;
	OFString *user;
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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
@property (copy) OFString *password;
@property (copy) OFString *path;
@property (copy) OFString *parameters;
@property (copy) OFString *query;
@property (copy) OFString *fragment;
#endif

/**
 * Creates a new URL with the specified string.
 *
 * \param string A string describing a URL
 * \return A new, autoreleased OFURL
 */
+ (instancetype)URLWithString: (OFString*)string;

/**
 * Creates a new URL with the specified string relative to the specified URL.
 *
 * \param string A string describing a URL
 * \param URL An URL to which the string is relative
 * \return A new, autoreleased OFURL
 */
+ (instancetype)URLWithString: (OFString*)string
		relativeToURL: (OFURL*)URL;

/**
 * \brief Initializes an already allocated OFURL with the specified string.
 *
 * \param string A string describing a URL
 * \return An initialized OFURL
 */
- initWithString: (OFString*)string;

/**
 * \brief Initializes an already allocated OFURL with the specified string and
 *	  relative URL.
 *
 * \param string A string describing a URL
 * \param URL A URL to which the string is relative
 * \return An initialized OFURL
 */
- initWithString: (OFString*)string
   relativeToURL: (OFURL*)url;

/**
 * \brief Returns the scheme part of the URL.
 *
 * \return The scheme part of the URL
 */
- (OFString*)scheme;

/**
 * \brief Set the scheme part of the URL.
 *
 * \param scheme The scheme part of the URL to set
 */
- (void)setScheme: (OFString*)scheme;

/**
 * \brief Returns the host part of the URL.
 *
 * \return The host part of the URL
 */
- (OFString*)host;

/**
 * \brief Set the host part of the URL.
 *
 * \param host The host part of the URL to set
 */
- (void)setHost: (OFString*)host;

/**
 * \brief Returns the port part of the URL.
 *
 * \return The port part of the URL
 */
- (uint16_t)port;

/**
 * \brief Set the port part of the URL.
 *
 * \param port The port part of the URL to set
 */
- (void)setPort: (uint16_t)port;

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

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

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

/**
 * \brief Set the password part of the URL.
 *
 * \param password The password part of the URL to set
 */
- (void)setPassword: (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;

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

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

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

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

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

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







|


|
|



|


|
|
|




|
|

|
|



|
|


|
|
|




|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



|
|

|



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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
@property (copy) OFString *password;
@property (copy) OFString *path;
@property (copy) OFString *parameters;
@property (copy) OFString *query;
@property (copy) OFString *fragment;
#endif

/*!
 * Creates a new URL with the specified string.
 *
 * @param string A string describing a URL
 * @return A new, autoreleased OFURL
 */
+ (instancetype)URLWithString: (OFString*)string;

/*!
 * Creates a new URL with the specified string relative to the specified URL.
 *
 * @param string A string describing a URL
 * @param URL An URL to which the string is relative
 * @return A new, autoreleased OFURL
 */
+ (instancetype)URLWithString: (OFString*)string
		relativeToURL: (OFURL*)URL;

/*!
 * @brief Initializes an already allocated OFURL with the specified string.
 *
 * @param string A string describing a URL
 * @return An initialized OFURL
 */
- initWithString: (OFString*)string;

/*!
 * @brief Initializes an already allocated OFURL with the specified string and
 *	  relative URL.
 *
 * @param string A string describing a URL
 * @param URL A URL to which the string is relative
 * @return An initialized OFURL
 */
- initWithString: (OFString*)string
   relativeToURL: (OFURL*)url;

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

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

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

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

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

/*!
 * @brief Set the port part of the URL.
 *
 * @param port The port part of the URL to set
 */
- (void)setPort: (uint16_t)port;

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

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

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

/*!
 * @brief Set the password part of the URL.
 *
 * @param password The password part of the URL to set
 */
- (void)setPassword: (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;

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

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

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

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

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

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