Differences From Artifact [a0cfce89af]:
- File src/OFXMLAttribute.m — part of check-in [ace6f683f7] at 2011-05-12 18:27:57 on branch trunk — Add version to serialization and add serialization to more classes. (user: js, size: 2156) [annotate] [blame] [check-ins using]
To Artifact [be193dc061]:
- File
src/OFXMLAttribute.m
— part of check-in
[494dca4ae4]
at
2011-05-14 12:26:39
on branch trunk
— Use XML for serialization.
This way, we don't need a new parser and don't use a new format. (user: js, size: 2272) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
15 16 17 18 19 20 21 22 23 24 25 26 27 28 | */ #include "config.h" #import "OFXMLAttribute.h" #import "OFString.h" #import "OFDictionary.h" #import "OFAutoreleasePool.h" @implementation OFXMLAttribute + attributeWithName: (OFString*)name namespace: (OFString*)ns stringValue: (OFString*)value { | > | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | */ #include "config.h" #import "OFXMLAttribute.h" #import "OFString.h" #import "OFDictionary.h" #import "OFXMLElement.h" #import "OFAutoreleasePool.h" @implementation OFXMLAttribute + attributeWithName: (OFString*)name namespace: (OFString*)ns stringValue: (OFString*)value { |
︙ | ︙ | |||
69 70 71 72 73 74 75 | } - (OFString*)stringValue { return [[stringValue copy] autorelease]; } | | | > | > > | > | > | > | > > < > | > | < > | | < | < < < < | < < | < | | 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | } - (OFString*)stringValue { return [[stringValue copy] autorelease]; } - (OFXMLElement*)XMLElementBySerializing { OFAutoreleasePool *pool; OFXMLElement *element; element = [OFXMLElement elementWithName: @"object" namespace: OF_SERIALIZATION_NS]; pool = [[OFAutoreleasePool alloc] init]; [element addAttributeWithName: @"class" stringValue: [self className]]; [element addChild: [OFXMLElement elementWithName: @"name" namespace: OF_SERIALIZATION_NS stringValue: name]]; if (ns != nil) [element addChild: [OFXMLElement elementWithName: @"namespace" namespace: OF_SERIALIZATION_NS stringValue: ns]]; [element addChild: [OFXMLElement elementWithName: @"stringValue" namespace: OF_SERIALIZATION_NS stringValue: stringValue]]; [pool release]; return element; } @end |