ObjFW
 
Loading...
Searching...
No Matches
OFMutableIRI.h
1/*
2 * Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
3 *
4 * All rights reserved.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3.0 only,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
13 * version 3.0 for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * version 3.0 along with this program. If not, see
17 * <https://www.gnu.org/licenses/>.
18 */
19
20#import "OFIRI.h"
21
22OF_ASSUME_NONNULL_BEGIN
23
33{
34 OF_RESERVE_IVARS(OFMutableIRI, 4)
35}
36
43@property (readwrite, copy, nonatomic) OFString *scheme;
44
48@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *host;
49
59@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic)
61
68@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFNumber *port;
69
73@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *user;
74
84@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic)
86
90@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *password;
91
101@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic)
103
107@property (readwrite, copy, nonatomic) OFString *path;
108
118@property (readwrite, copy, nonatomic) OFString *percentEncodedPath;
119
128@property (readwrite, copy, nonatomic)
130
134@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *query;
135
145@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic)
147
161@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic)
162 OFArray OF_GENERIC(OFPair OF_GENERIC(OFString *, OFString *) *) *queryItems;
163
167@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic) OFString *fragment;
168
178@property OF_NULLABLE_PROPERTY (readwrite, copy, nonatomic)
180
187+ (instancetype)IRIWithScheme: (OFString *)scheme;
188
196- (instancetype)initWithScheme: (OFString *)scheme;
197
203- (void)appendPathComponent: (OFString *)component;
204
212- (void)appendPathComponent: (OFString *)component
213 isDirectory: (bool)isDirectory;
214
220- (void)appendPathExtension: (OFString *)extension;
221
226
230- (void)deletePathExtension;
231
235- (void)standardizePath;
236
240- (void)makeImmutable;
241@end
242
243OF_ASSUME_NONNULL_END
An abstract class for storing objects in an array.
Definition OFArray.h:109
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition OFIRI.h:41
A class for representing IRIs, URIs, URLs and URNs, for parsing them, accessing parts of them as well...
Definition OFMutableIRI.h:33
OFString * percentEncodedUser
The user part of the IRI in percent-encoded form.
Definition OFMutableIRI.h:85
OFString * percentEncodedFragment
The fragment part of the IRI in percent-encoded form.
Definition OFMutableIRI.h:179
OFString * scheme
The scheme part of the IRI.
Definition OFMutableIRI.h:43
OFString * percentEncodedPassword
The password part of the IRI in percent-encoded form.
Definition OFMutableIRI.h:102
OFString * host
The host part of the IRI.
Definition OFMutableIRI.h:48
void deletePathExtension()
Deletes the path extension.
Definition OFMutableIRI.m:442
OFString * percentEncodedHost
The host part of the IRI in percent-encoded form.
Definition OFMutableIRI.h:60
OFNumber * port
The port part of the IRI.
Definition OFMutableIRI.h:68
OFString * fragment
The fragment part of the IRI.
Definition OFMutableIRI.h:167
void standardizePath()
Resolves relative subpaths.
Definition OFMutableIRI.m:473
OFString * path
The path part of the IRI.
Definition OFMutableIRI.h:107
OFString * user
The user part of the IRI.
Definition OFMutableIRI.h:73
OFString * percentEncodedQuery
The query part of the IRI in percent-encoded form.
Definition OFMutableIRI.h:146
OFString * query
The query part of the IRI.
Definition OFMutableIRI.h:134
OFString * password
The password part of the IRI.
Definition OFMutableIRI.h:90
void deleteLastPathComponent()
Deletes the last path component.
Definition OFMutableIRI.m:414
OFString * percentEncodedPath
The path part of the IRI in percent-encoded form.
Definition OFMutableIRI.h:118
OFArray * queryItems
The query part of the IRI as an array.
Definition OFMutableIRI.h:162
OFArray * pathComponents
The path of the IRI split into components.
Definition OFMutableIRI.h:129
void makeImmutable()
Converts the mutable IRI to an immutable IRI.
Definition OFMutableIRI.m:528
Provides a way to store a number in an object.
Definition OFNumber.h:47
id copy()
Returns the class.
Definition OFObject.m:1407
A class for storing a pair of two objects.
Definition OFPair.h:40
A class for handling strings.
Definition OFString.h:143