747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
|
self = [super init];
@try {
void *pool = objc_autoreleasePoolPush();
OFString *typeString;
if (![element.name isEqual: @"OFNumber"] ||
![element.namespace isEqual: OF_SERIALIZATION_NS])
@throw [OFInvalidArgumentException exception];
typeString = [element attributeForName: @"type"].stringValue;
if ([typeString isEqual: @"bool"]) {
OFString *stringValue = element.stringValue;
if ([stringValue isEqual: @"true"])
|
|
|
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
|
self = [super init];
@try {
void *pool = objc_autoreleasePoolPush();
OFString *typeString;
if (![element.name isEqual: @"OFNumber"] ||
![element.namespace isEqual: OFSerializationNS])
@throw [OFInvalidArgumentException exception];
typeString = [element attributeForName: @"type"].stringValue;
if ([typeString isEqual: @"bool"]) {
OFString *stringValue = element.stringValue;
if ([stringValue isEqual: @"true"])
|
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
|
- (OFXMLElement *)XMLElementBySerializing
{
void *pool = objc_autoreleasePoolPush();
OFXMLElement *element;
element = [OFXMLElement elementWithName: @"OFNumber"
namespace: OF_SERIALIZATION_NS
stringValue: self.description];
if (*self.objCType == 'B')
[element addAttributeWithName: @"type" stringValue: @"bool"];
else if (isFloat(self)) {
[element addAttributeWithName: @"type" stringValue: @"float"];
element.stringValue = [OFString
|
|
|
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
|
- (OFXMLElement *)XMLElementBySerializing
{
void *pool = objc_autoreleasePoolPush();
OFXMLElement *element;
element = [OFXMLElement elementWithName: @"OFNumber"
namespace: OFSerializationNS
stringValue: self.description];
if (*self.objCType == 'B')
[element addAttributeWithName: @"type" stringValue: @"bool"];
else if (isFloat(self)) {
[element addAttributeWithName: @"type" stringValue: @"float"];
element.stringValue = [OFString
|