@@ -17,11 +17,10 @@ #include #import "OFList.h" #import "OFString.h" -#import "OFXMLElement.h" #import "OFArray.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" @@ -67,39 +66,10 @@ + (instancetype)list { return [[[self alloc] init] autorelease]; } -- (instancetype)initWithSerialization: (OFXMLElement *)element -{ - self = [self init]; - - @try { - void *pool = objc_autoreleasePoolPush(); - - if (![element.name isEqual: self.className] || - ![element.namespace isEqual: OFSerializationNS]) - @throw [OFInvalidArgumentException exception]; - - for (OFXMLElement *child in - [element elementsForNamespace: OFSerializationNS]) { - void *pool2 = objc_autoreleasePoolPush(); - - [self appendObject: child.objectByDeserializing]; - - objc_autoreleasePoolPop(pool2); - } - - objc_autoreleasePoolPop(pool); - } @catch (id e) { - [self release]; - @throw e; - } - - return self; -} - - (void)dealloc { OFListItem next; for (OFListItem iter = _firstListItem; iter != NULL; iter = next) { @@ -371,28 +341,10 @@ [ret makeImmutable]; return ret; } -- (OFXMLElement *)XMLElementBySerializing -{ - OFXMLElement *element = - [OFXMLElement elementWithName: self.className - namespace: OFSerializationNS]; - - for (OFListItem iter = _firstListItem; - iter != NULL; iter = iter->next) { - void *pool = objc_autoreleasePoolPush(); - - [element addChild: [iter->object XMLElementBySerializing]]; - - objc_autoreleasePoolPop(pool); - } - - return element; -} - - (int)countByEnumeratingWithState: (OFFastEnumerationState *)state objects: (id *)objects count: (int)count { OFListItem listItem;