Differences From Artifact [6b8bc772b6]:
- File
src/OFMutableDictionary.m
— part of check-in
[2a27cf3000]
at
2016-01-03 00:41:26
on branch trunk
— Update copyright
While at it, also update the mail address. (user: js, size: 3993) [annotate] [blame] [check-ins using]
To Artifact [87db87aaf2]:
- File
src/OFMutableDictionary.m
— part of check-in
[cbacea7ca3]
at
2016-06-05 14:32:21
on branch trunk
— Implement Key Value Coding for OFDictionary
If the key starts with an @, the @ is stripped and the super method is
called. Otherwise, this is equivalent to -[objectForKey:] /
-[setValue:forKey:]. (user: js, size: 4344) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #include "config.h" #include <stdlib.h> #import "OFMutableDictionary_hashtable.h" #import "OFArray.h" static struct { Class isa; } placeholder; @interface OFMutableDictionary_placeholder: OFDictionary @end | > | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #include "config.h" #include <stdlib.h> #import "OFMutableDictionary_hashtable.h" #import "OFArray.h" #import "OFString.h" static struct { Class isa; } placeholder; @interface OFMutableDictionary_placeholder: OFDictionary @end |
︙ | ︙ | |||
171 172 173 174 175 176 177 178 179 180 181 182 183 184 | - (void)setObject: (id)object forKeyedSubscript: (id)key { [self setObject: object forKey: key]; } - (void)removeObjectForKey: (id)key { OF_UNRECOGNIZED_SELECTOR } - (void)removeAllObjects | > > > > > > > > > > > > > > > > > > | 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | - (void)setObject: (id)object forKeyedSubscript: (id)key { [self setObject: object forKey: key]; } - (void)setValue: (id)value forKey: (OFString*)key { if ([key hasPrefix: @"@"]) { void *pool = objc_autoreleasePoolPush(); key = [key substringWithRange: of_range(1, [key length] - 1)]; [super setValue: value forKey: key]; objc_autoreleasePoolPop(pool); return; } [self setObject: value forKey: key]; } - (void)removeObjectForKey: (id)key { OF_UNRECOGNIZED_SELECTOR } - (void)removeAllObjects |
︙ | ︙ |