ObjFW
OFURL.h
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
3  * Jonathan Schleifer <js@heap.zone>
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 
39 @property (readonly, nonatomic, copy) OFString *scheme;
40 
44 @property (readonly, nonatomic, copy) OFString *host;
45 
49 @property (readonly, nonatomic) uint16_t port;
50 
54 @property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *user;
55 
59 @property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *password;
60 
64 @property (readonly, nonatomic, copy) OFString *path;
65 
69 @property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *parameters;
70 
74 @property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *query;
75 
79 @property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *fragment;
80 
87 + (instancetype)URLWithString: (OFString *)string;
88 
97 + (instancetype)URLWithString: (OFString *)string
98  relativeToURL: (OFURL *)URL;
99 
106 + (instancetype)fileURLWithPath: (OFString *)path;
107 
108 - init OF_UNAVAILABLE;
109 
116 - initWithString: (OFString *)string;
117 
126 - initWithString: (OFString *)string
127  relativeToURL: (OFURL *)URL;
128 
134 - (OFString *)string;
135 @end
136 
137 OF_ASSUME_NONNULL_END
138 
139 #import "OFMutableURL.h"
A protocol for the creation of mutable copies.
Definition: OFObject.h:933
id copy()
Returns the class.
Definition: OFObject.m:1133
A class for handling strings.
Definition: OFString.h:114
A class for parsing URLs and accessing parts of it.
Definition: OFURL.h:29
id init()
Initializes an already allocated object.
Definition: OFObject.m:488
readonly
Definition: OFURL.h:55
A protocol for the creation of copies.
Definition: OFObject.h:912
uint16_t port
Definition: OFURL.h:50
The root class for all other classes inside ObjFW.
Definition: OFObject.h:379
A protocol for serializing objects.
Definition: OFSerialization.h:30
OFString * path
Definition: OFURL.h:65
OFString * host
Definition: OFURL.h:45
OFString * scheme
Definition: OFURL.h:40