@@ -82,14 +82,16 @@ { return [[[self alloc] initWithContentsOfFile: path] autorelease]; } #endif +#if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) + (instancetype)dataArrayWithContentsOfURL: (OFURL*)URL { return [[[self alloc] initWithContentsOfURL: URL] autorelease]; } +#endif + (instancetype)dataArrayWithStringRepresentation: (OFString*)string { return [[[self alloc] initWithStringRepresentation: string] autorelease]; @@ -184,25 +186,26 @@ return self; } #endif +#if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS) - initWithContentsOfURL: (OFURL*)URL { void *pool; OFString *scheme; pool = objc_autoreleasePoolPush(); scheme = [URL scheme]; -#ifdef OF_HAVE_FILES +# ifdef OF_HAVE_FILES if ([scheme isEqual: @"file"]) self = [self initWithContentsOfFile: [URL path]]; else -#endif -#ifdef OF_HAVE_SOCKETS +# endif +# ifdef OF_HAVE_SOCKETS if ([scheme isEqual: @"http"] || [scheme isEqual: @"https"]) { self = [self init]; @try { OFHTTPClient *client = [OFHTTPClient client]; @@ -247,17 +250,18 @@ } @catch (id e) { [self release]; @throw e; } } else -#endif +# endif @throw [OFUnsupportedProtocolException exceptionWithURL: URL]; objc_autoreleasePoolPop(pool); return self; } +#endif - initWithStringRepresentation: (OFString*)string { @try { const char *cString;