ObjFW  Diff

Differences From Artifact [f7f23cc369]:

To Artifact [3cbefbabba]:

  • File src/OFURL.h — part of check-in [48980f2297] at 2015-11-29 11:43:05 on branch trunk — Make properties a requirement and clean up code

    This increases the required GCC version from 4.0 to 4.6 (exception:
    Apple GCC, which already supports this with >= 4.0 starting with OS X
    10.5). Since even GCC 4.6 is really old by now, there is no point in
    still supporting something even older and making the code ugly because
    of that. While some hardware and OS support was dropped from GCC 4.6
    compared to GCC 4.0, there is nothing in there that would be an
    interesting target with the exception of BeOS maybe - but a port to BeOS
    can also be achieved using the Haiku support. The other dropped OSes are
    mostly old versions of OSes while newer ones are still being supported
    (and those newer versions of those OSes still support the same
    hardware). (user: js, size: 2942) [annotate] [blame] [check-ins using]


29
30
31
32
33
34
35




36



37




38




39









40




41
42









43
44
45
46
47
48
49
@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, *host;




@property uint16_t port;




@property OF_NULLABLE_PROPERTY (copy) OFString *user, *password;









@property (copy) OFString *path;




@property OF_NULLABLE_PROPERTY (copy) OFString *parameters, *query, *fragment;
#endif










/*!
 * Creates a new URL.
 *
 * @return A new, autoreleased OFURL
 */
+ (instancetype)URL;







>
>
>
>
|
>
>
>
|
>
>
>
>

>
>
>
>
|
>
>
>
>
>
>
>
>
>

>
>
>
>
|
|
>
>
>
>
>
>
>
>
>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
@interface OFURL: OFObject <OFCopying, OFSerialization>
{
	OFString *_scheme, *_host;
	uint16_t _port;
	OFString *_user, *_password, *_path, *_parameters, *_query, *_fragment;
}

/*!
 * The scheme part of the URL.
 */
@property (copy) OFString *scheme;

/*!
 * The host part of the URL.
 */
@property (copy) OFString *host;

/*!
 * The port part of the URL.
 */
@property uint16_t port;

/*!
 * The user part of the URL.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *user;

/*!
 * The password part of the URL.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *password;

/*!
 * The path part of the URL.
 */
@property (copy) OFString *path;

/*!
 * The parameters part of the URL.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *parameters;

/*!
 * The query part of the URL.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *query;

/*!
 * The fragment part of the URL.
 */
@property OF_NULLABLE_PROPERTY (copy) OFString *fragment;

/*!
 * Creates a new URL.
 *
 * @return A new, autoreleased OFURL
 */
+ (instancetype)URL;
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
220
221
222
 * @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
 */
- (nullable OFString*)user;

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

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

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

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

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

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

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

/*!
 * @brief Set the fragment part of the URL.
 *
 * @param fragment The fragment part of the URL to set
 */
- (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








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








118
119
120
121
122
123
124
125






























































































































126
127
128
129
130
131
132
133
 * @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 URL as a string.
 *
 * @return The URL as a string
 */
- (OFString*)string;
@end

OF_ASSUME_NONNULL_END