#include <URL.h>
Uniform Resource Locators (RFC 3986).
- See also
- http://www.ietf.org/rfc/rfc3986.txt
Definition at line 44 of file URL.h.
◆ fragment
The fragment.
Definition at line 60 of file URL.h.
◆ host
The host.
Definition at line 65 of file URL.h.
◆ interface
URLInterface* URL::interface |
|
protected |
The interface.
Definition at line 55 of file URL.h.
◆ object
The superclass.
Definition at line 49 of file URL.h.
◆ path
The path.
Definition at line 70 of file URL.h.
◆ port
The port.
Definition at line 75 of file URL.h.
◆ query
The query.
Definition at line 80 of file URL.h.
◆ scheme
The scheme, or protocol.
Definition at line 85 of file URL.h.
◆ urlString
◆ _URL()
The URL archetype.
- Returns
- The URL Class.
Definition at line 248 of file URL.c.
248 {
251
254 .name = "URL",
256 .instanceSize =
sizeof(
URL),
258 .interfaceSize = sizeof(URLInterface),
261 });
262 });
263
265}
Class * _initialize(const ClassDef *def)
Initializes the given Class.
static void destroy(Class *clazz)
static void initialize(Class *clazz)
#define do_once(once, block)
Executes the given block at most one time.
ClassDefs are passed to _initialize via an archetype to initialize a Class.
The runtime representation of a Class.
Class * clazz
Every instance of Object begins with a pointer to its Class.
Class * _Object(void)
The Object archetype.
Uniform Resource Locators (RFC 3986).
URLInterface * interface
The interface.
◆ baseURL()
URL * baseURL |
( |
const URL * |
self | ) |
|
- Parameters
-
- Returns
- The base URL (scheme, host, and port) of this URL.
Definition at line 108 of file URL.c.
108 {
109
111
114
117 }
118
121 }
122
124
126
128}
ident release(ident obj)
Atomically decrement the given Object's reference count. If the resulting reference count is 0,...
#define alloc(type)
Allocate and initialize and instance of type.
static void appendFormat(MutableString *self, const char *fmt,...)
static void appendString(MutableString *self, const String *string)
Object * init(Object *self)
Initializes this Object.
unsigned short port
The port.
URL * baseURL(const URL *self)
String * scheme
The scheme, or protocol.
URL * initWithString(URL *self, const String *string)
Initializes this URL with the specified String.
◆ initWithCharacters()
URL * initWithCharacters |
( |
URL * |
self, |
|
|
const char * |
chars |
|
) |
| |
Initializes this URL with the specified characters.
- Parameters
-
self | The URL. |
chars | The URL characters. |
- Returns
- The initialized URL, or
NULL
on error.
Definition at line 136 of file URL.c.
136 {
137
138 assert(chars);
139
141 if (self) {
142
145
147
154
156
157 if (
host->location > -1) {
159
160 if (
port->location > -1) {
162 self->
port = strtoul(s, NULL, 10);
163 }
164 }
165
166 if (
path->location > -1) {
168 }
169
170 if (
query->location > -1) {
171
174
176 }
177
179
182
184 }
185
186 free(ranges);
187 } else {
189 }
190 }
191
192 return self;
193}
#define super(type, obj, method,...)
static _Bool matchesCharacters(const Regexp *self, const char *chars, int options, Range **ranges)
static String * substring(const String *self, const Range range)
Object is the root Class of The Objectively Class hierarchy.
A location and length into contiguous collections.
char * chars
The backing null-terminated UTF-8 encoded character array.
size_t length
The length of the String in bytes.
String * urlString
The URL String.
String * fragment
The fragment.
URL * initWithCharacters(URL *self, const char *chars)
Initializes this URL with the specified characters.
◆ initWithString()
Initializes this URL with the specified String.
- Parameters
-
- Returns
- The initialized URL, or
NULL
on error.
Definition at line 199 of file URL.c.
199 {
200
201 assert(string);
202
204}
static MutableString * string(void)
◆ pathComponents()
Array * pathComponents |
( |
const URL * |
self | ) |
|
- Parameters
-
- Returns
- The
path
components of this URL.
Definition at line 210 of file URL.c.
210 {
211
213}
static Array * componentsSeparatedByCharacters(const String *self, const char *chars)
The documentation for this struct was generated from the following files:
- Sources/Objectively/URL.h
- Sources/Objectively/URL.c