Differences From Artifact [d97af29834]:
- File
src/OFXMLElement.m
— part of check-in
[67bb344ba6]
at
2009-06-30 12:07:21
on branch trunk
— A few renames in OFObject, see details.
* +[conformsTo:] to +[conformsToProtocol:].
* -[isKindOf:] to -[isKindOfClass:].
* -[respondsTo:] to -[respondsToSelector:].
* -[conformsTo:] to -[conformsToProtocol:].
* -[methodFor:] to -[methodForSelector:]. (user: js, size: 5168) [annotate] [blame] [check-ins using]
To Artifact [ffae94dc12]:
- File src/OFXMLElement.m — part of check-in [4eae61a78f] at 2009-07-19 14:05:30 on branch trunk — Rename andFoo: to foo: in all methods. (user: js, size: 5164) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
24 25 26 27 28 29 30 | @implementation OFXMLElement + elementWithName: (OFString*)name_ { return [[[self alloc] initWithName: name_] autorelease]; } + elementWithName: (OFString*)name_ | | | | | | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | @implementation OFXMLElement + elementWithName: (OFString*)name_ { return [[[self alloc] initWithName: name_] autorelease]; } + elementWithName: (OFString*)name_ stringValue: (OFString*)stringval_ { return [[[self alloc] initWithName: name_ stringValue: stringval_] autorelease]; } - initWithName: (OFString*)name_ { self = [super init]; name = [name_ retain]; return self; } - initWithName: (OFString*)name_ stringValue: (OFString*)stringval_ { self = [super init]; name = [name_ retain]; stringval = [stringval_ retain]; return self; |
︙ | ︙ | |||
156 157 158 159 160 161 162 | [self freeMemory: str_c]; } return ret; } - addAttributeWithName: (OFString*)name_ | | | | 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | [self freeMemory: str_c]; } return ret; } - addAttributeWithName: (OFString*)name_ stringValue: (OFString*)value_ { if (attrs == nil) attrs = [[OFMutableDictionary alloc] init]; [attrs setObject: value_ forKey: name_]; return self; } - addChild: (OFXMLElement*)child { if (stringval != nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; if (children == nil) children = [[OFMutableArray alloc] init]; [children addObject: child]; return self; |
︙ | ︙ | |||
208 209 210 211 212 213 214 | len = length + 1; /* * We can't use allocMemoryWithSize: here as it might be a @"" literal */ if ((str_c = malloc(len + 1)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa | | | 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | len = length + 1; /* * We can't use allocMemoryWithSize: here as it might be a @"" literal */ if ((str_c = malloc(len + 1)) == NULL) @throw [OFOutOfMemoryException newWithClass: isa size: len]; for (i = 0; i < length; i++) { switch (string[i]) { case '<': append = "<"; append_len = 4; break; |
︙ | ︙ | |||
242 243 244 245 246 247 248 | } if (append != NULL) { if ((tmp = realloc(str_c, len + append_len)) == NULL) { free(str_c); @throw [OFOutOfMemoryException newWithClass: isa | | | 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 | } if (append != NULL) { if ((tmp = realloc(str_c, len + append_len)) == NULL) { free(str_c); @throw [OFOutOfMemoryException newWithClass: isa size: len + append_len]; } str_c = tmp; len += append_len - 1; memcpy(str_c + j, append, append_len); j += append_len; } else |
︙ | ︙ |