1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
|
- (instancetype)initWithSerialization: (OFXMLElement *)element
{
void *pool = objc_autoreleasePoolPush();
OFString *stringValue;
@try {
if (![element.namespace isEqual: OF_SERIALIZATION_NS])
@throw [OFInvalidArgumentException exception];
if ([self isKindOfClass: [OFMutableString class]]) {
if (![element.name isEqual: @"OFMutableString"])
@throw [OFInvalidArgumentException exception];
} else {
if (![element.name isEqual: @"OFString"])
|
|
|
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
|
- (instancetype)initWithSerialization: (OFXMLElement *)element
{
void *pool = objc_autoreleasePoolPush();
OFString *stringValue;
@try {
if (![element.namespace isEqual: OFSerializationNS])
@throw [OFInvalidArgumentException exception];
if ([self isKindOfClass: [OFMutableString class]]) {
if (![element.name isEqual: @"OFMutableString"])
@throw [OFInvalidArgumentException exception];
} else {
if (![element.name isEqual: @"OFString"])
|
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
|
if ([self isKindOfClass: [OFMutableString class]])
className = @"OFMutableString";
else
className = @"OFString";
element = [OFXMLElement elementWithName: className
namespace: OF_SERIALIZATION_NS
stringValue: self];
[element retain];
objc_autoreleasePoolPop(pool);
return [element autorelease];
|
|
|
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
|
if ([self isKindOfClass: [OFMutableString class]])
className = @"OFMutableString";
else
className = @"OFString";
element = [OFXMLElement elementWithName: className
namespace: OFSerializationNS
stringValue: self];
[element retain];
objc_autoreleasePoolPop(pool);
return [element autorelease];
|