40 const URL *
this = (
URL *) self;
67 const URL *
this = (
URL *) self;
77 const URL *
this = (
URL *) self;
93 const URL *
this = (
URL *) self;
94 const URL *that = (
URL *) other;
148 Range *scheme = &ranges[1];
149 Range *host = &ranges[2];
150 Range *port = &ranges[3];
151 Range *path = &ranges[4];
152 Range *query = &ranges[5];
153 Range *fragment = &ranges[6];
162 self->
port = strtoul(s, NULL, 10);
215#pragma mark - Class lifecycle
241 _re =
re(
"([a-z]+)://([^:/\?]+)?(:[0-9]+)?(/[^\?#]+)?([^#]+)?(#.*)?", 0);
256 .instanceSize =
sizeof(
URL),
257 .interfaceOffset = offsetof(
URL, interface),
258 .interfaceSize =
sizeof(URLInterface),
static Array * init(Array *self)
ident release(ident obj)
Atomically decrement the given Object's reference count. If the resulting reference count is 0,...
Class * _initialize(const ClassDef *def)
Initializes the given Class.
#define alloc(type)
Allocate and initialize and instance of type.
#define super(type, obj, method,...)
static bool matchesCharacters(const Regexp *self, const char *chars, int options, Range **ranges)
Regexp * re(const char *pattern, int options)
Extended POSIX regular expressions.
static String * string(void)
static String * substring(const String *self, const Range range)
static void appendFormat(String *self, const char *fmt,...)
static Array * componentsSeparatedByCharacters(const String *self, const char *chars)
static void appendString(String *self, const String *string)
static void destroy(Class *clazz)
static Array * pathComponents(const URL *self)
static bool isEqual(const Object *self, const Object *other)
static URL * initWithString(URL *self, const String *string)
static String * description(const Object *self)
static URL * baseURL(const URL *self)
static void dealloc(Object *self)
static Object * copy(const Object *self)
static void initialize(Class *clazz)
static URL * initWithCharacters(URL *self, const char *chars)
static int hash(const Object *self)
Uniform Resource Locators (RFC 3986).
#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.
ident interface
The interface of the Class.
Object is the root Class of The Objectively Class hierarchy.
Class * clazz
Every instance of Object begins with a pointer to its Class.
int hash(const Object *self)
void dealloc(Object *self)
Frees all resources held by this Object.
A location and length into contiguous collections.
ssize_t location
The location.
Extended POSIX regular expressions.
char * chars
The backing null-terminated UTF-8 encoded character array.
Uniform Resource Locators (RFC 3986).
unsigned short port
The port.
Array * pathComponents(const URL *self)
String * urlString
The URL String.
String * scheme
The scheme, or protocol.
URL * initWithString(URL *self, const String *string)
Initializes this URL with the specified String.
String * fragment
The fragment.
URL * initWithCharacters(URL *self, const char *chars)
Initializes this URL with the specified characters.