45 {
46
47 assert(root);
48 assert(path);
49
50 assert(*path == '$');
51 const char *c = path;
52
55
58 break;
59 }
60
61 const uint8_t *bytes = (uint8_t *) c + matches[1].location;
62 const size_t length = matches[1].
length;
63
65 if (*segment->
chars ==
'.') {
66
69
71
73
75
76 }
else if (*segment->
chars ==
'[') {
77
79 const unsigned long index = strtoul(segment->
chars + 1, NULL, 10);
80 if (index < array->count) {
82 } else {
84 }
85 }
87
88 c += length;
89 }
90
92}
#define cast(type, obj)
Safely cast obj to type.
void * ident
The identity type, similar to Objective-C id.
ident objectAtIndex(const Array *self, int index)
Immutable key-value stores.
ident objectForKey(const Dictionary *self, const ident key)
MutableArray * array(void)
Returns a new MutableArray.
MutableDictionary * dictionary(void)
Returns a new MutableDictionary.
A location and length into contiguous collections.
ssize_t location
The location.
_Bool matchesCharacters(const Regexp *self, const char *chars, int options, Range **matches)
Matches this regular expression against the given characters.
char * chars
The backing null-terminated UTF-8 encoded character array.
size_t length
The length of the String in bytes.
String * stringWithBytes(const uint8_t *bytes, size_t length, StringEncoding encoding)
Returns a new String by decoding length of bytes to UTF-8.
String * substring(const String *string, const Range range)
Creates a new String from a subset of this one.