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 *_Nullable _user, *_Nullable _password, *_path;
34  OFString *_Nullable _parameters, *_Nullable _query;
35  OFString *_Nullable _fragment;
36 }
37 
41 @property (readonly, nonatomic, copy) OFString *scheme;
42 
46 @property (readonly, nonatomic, copy) OFString *host;
47 
51 @property (readonly, nonatomic) uint16_t port;
52 
56 @property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *user;
57 
61 @property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *password;
62 
66 @property (readonly, nonatomic, copy) OFString *path;
67 
71 @property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *parameters;
72 
76 @property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *query;
77 
81 @property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *fragment;
82 
89 + (instancetype)URLWithString: (OFString *)string;
90 
99 + (instancetype)URLWithString: (OFString *)string
100  relativeToURL: (OFURL *)URL;
101 
108 + (instancetype)fileURLWithPath: (OFString *)path;
109 
110 - init OF_UNAVAILABLE;
111 
118 - initWithString: (OFString *)string;
119 
128 - initWithString: (OFString *)string
129  relativeToURL: (OFURL *)URL;
130 
136 - (OFString *)string;
137 @end
138 
139 OF_ASSUME_NONNULL_END
140 
141 #import "OFMutableURL.h"
A protocol for the creation of mutable copies.
Definition: OFObject.h:935
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:57
A protocol for the creation of copies.
Definition: OFObject.h:914
uint16_t port
Definition: OFURL.h:52
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:67
OFString * host
Definition: OFURL.h:47
OFString * scheme
Definition: OFURL.h:42