Index: src/OFURL.h ================================================================== --- src/OFURL.h +++ src/OFURL.h @@ -13,17 +13,18 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" +#import "OFSerialization.h" @class OFString; /** * \brief A class for parsing URLs and accessing parts of it. */ -@interface OFURL: OFObject +@interface OFURL: OFObject { OFString *scheme; OFString *host; uint16_t port; OFString *user; Index: src/OFURL.m ================================================================== --- src/OFURL.m +++ src/OFURL.m @@ -527,6 +527,22 @@ - (OFString*)description { return [self string]; } + +- (OFString*)stringBySerializing +{ + OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + OFString *ret = [[OFString alloc] + initWithFormat: @"(class=OFURL)<%@>", + [[self string] stringBySerializing]]; + + @try { + [pool release]; + } @finally { + [ret autorelease]; + } + + return ret; +} @end Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -13,10 +13,11 @@ * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #import "OFObject.h" +#import "OFSerialization.h" @class OFString; @class OFArray; @class OFMutableString; @class OFMutableArray; @@ -24,11 +25,11 @@ @class OFXMLAttribute; /** * \brief A class which stores an XML element. */ -@interface OFXMLElement: OFObject +@interface OFXMLElement: OFObject { OFString *name; OFString *ns; OFString *defaultNamespace; OFMutableArray *attributes; Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -566,10 +566,26 @@ - (OFString*)description { return [self XMLString]; } + +- (OFString*)stringBySerializing +{ + OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + OFString *ret = [[OFString alloc] + initWithFormat: @"(class=OFXMLElement)<%@>", + [[self XMLString] stringBySerializing]]; + + @try { + [pool release]; + } @finally { + [ret autorelease]; + } + + return ret; +} - (void)addAttribute: (OFXMLAttribute*)attribute { if (name == nil) @throw [OFInvalidArgumentException newWithClass: isa