@@ -22,42 +22,42 @@ #import "OFExceptions.h" int _OFXMLElement_reference; @implementation OFXMLAttribute -+ attributeWithName: (OFString*)name_ - prefix: (OFString*)prefix_ - namespace: (OFString*)ns_ - stringValue: (OFString*)value_ -{ - return [[[self alloc] initWithName: name_ - prefix: prefix_ - namespace: ns_ - stringValue: value_] autorelease]; ++ attributeWithName: (OFString*)name + prefix: (OFString*)prefix + namespace: (OFString*)ns + stringValue: (OFString*)value +{ + return [[[self alloc] initWithName: name + prefix: prefix + namespace: ns + stringValue: value] autorelease]; } - initWithName: (OFString*)name_ prefix: (OFString*)prefix_ - namespace: (OFString*)ns_ - stringValue: (OFString*)value_ + namespace: (OFString*)ns + stringValue: (OFString*)value { self = [super init]; name = [name_ copy]; prefix = [prefix_ copy]; - ns = [ns_ copy]; - value = [value_ copy]; + namespace = [ns copy]; + stringValue = [value copy]; return self; } - (void)dealloc { [name release]; [prefix release]; - [ns release]; - [value release]; + [namespace release]; + [stringValue release]; [super dealloc]; } - (OFString*)name @@ -70,30 +70,30 @@ return [[prefix copy] autorelease]; } - (OFString*)namespace { - return [[ns copy] autorelease]; + return [[namespace copy] autorelease]; } - (OFString*)stringValue { - return [[value copy] autorelease]; + return [[stringValue copy] autorelease]; } @end @implementation OFXMLElement + elementWithName: (OFString*)name_ { return [[[self alloc] initWithName: name_] autorelease]; } -+ elementWithName: (OFString*)name_ - stringValue: (OFString*)stringval_ ++ elementWithName: (OFString*)name + stringValue: (OFString*)stringval { - return [[[self alloc] initWithName: name_ - stringValue: stringval_] autorelease]; + return [[[self alloc] initWithName: name + stringValue: stringval] autorelease]; } - init { @throw [OFNotImplementedException newWithClass: isa @@ -108,16 +108,16 @@ return self; } - initWithName: (OFString*)name_ - stringValue: (OFString*)stringval_ + stringValue: (OFString*)stringval { self = [super init]; name = [name_ copy]; - stringval = [stringval_ copy]; + stringValue = [stringval copy]; return self; } - (OFString*)string @@ -135,12 +135,12 @@ *str_c = '<'; memcpy(str_c + 1, [name cString], [name cStringLength]); i = [name cStringLength] + 1; /* Attributes */ - attrs_carray = [attrs cArray]; - attrs_count = [attrs count]; + attrs_carray = [attributes cArray]; + attrs_count = [attributes count]; for (j = 0; j < attrs_count; j++) { /* FIXME: Add namespace support */ OFString *attr_name = [attrs_carray[j] name]; tmp = [[attrs_carray[j] stringValue] stringByXMLEscaping]; @@ -166,13 +166,13 @@ [pool releaseObjects]; } /* Childen */ - if (stringval != nil || children != nil) { - if (stringval != nil) - tmp = [stringval stringByXMLEscaping]; + if (stringValue != nil || children != nil) { + if (stringValue != nil) + tmp = [stringValue stringByXMLEscaping]; else if (children != nil) { OFXMLElement **children_carray = [children cArray]; size_t children_count = [children count]; IMP append; @@ -219,16 +219,16 @@ return ret; } - (void)addAttribute: (OFXMLAttribute*)attr { - if (attrs == nil) - attrs = [[OFMutableArray alloc] init]; + if (attributes == nil) + attributes = [[OFMutableArray alloc] init]; /* FIXME: Prevent having it twice! */ - [attrs addObject: attr]; + [attributes addObject: attr]; } - (void)addAttributeWithName: (OFString*)name_ stringValue: (OFString*)value { @@ -243,11 +243,11 @@ /* TODO: Replace attribute */ /* TODO: Remove attribute */ - (void)addChild: (OFXMLElement*)child { - if (stringval != nil) + if (stringValue != nil) @throw [OFInvalidArgumentException newWithClass: isa selector: _cmd]; if (children == nil) children = [[OFMutableArray alloc] init]; @@ -256,12 +256,12 @@ } - (void)dealloc { [name release]; - [attrs release]; - [stringval release]; + [attributes release]; + [stringValue release]; [children release]; [super dealloc]; } @end