ObjFW  Diff

Differences From Artifact [6c49aac468]:

To Artifact [b724e2f129]:


1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076

1077

1078
1079

1080
1081
1082
1083
1084
1085

1086
1087

1088
1089

1090
1091
1092
1093






1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1060
1061
1062
1063
1064
1065
1066

1067
1068
1069
1070
1071
1072
1073
1074
1075
1076

1077


1078




1079

1080


1081


1082

1083


1084
1085
1086
1087
1088
1089
1090
1091

1092
1093
1094
1095
1096
1097
1098







-









+
-
+
-
-
+
-
-
-
-

-
+
-
-
+
-
-
+
-

-
-
+
+
+
+
+
+


-







			      length: (size_t)fileSize];
	[self freeMemory: tmp];

	return self;
}
#endif

#if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS)
- (instancetype)initWithContentsOfURL: (OFURL *)URL
{
	return [self initWithContentsOfURL: URL
				  encoding: OF_STRING_ENCODING_AUTODETECT];
}

- (instancetype)initWithContentsOfURL: (OFURL *)URL
			     encoding: (of_string_encoding_t)encoding
{
	@try {
	void *pool = objc_autoreleasePoolPush();
		void *pool = objc_autoreleasePoolPush();
	OFString *scheme = [URL scheme];

		OFData *data = [OFData dataWithContentsOfURL: URL];
# ifdef OF_HAVE_FILES
	if ([scheme isEqual: @"file"]) {
		if (encoding == OF_STRING_ENCODING_AUTODETECT)
			encoding = OF_STRING_ENCODING_UTF_8;

		self = [self
		self = [self initWithCString: [data items]
		    initWithContentsOfFile: [URL fileSystemRepresentation]
				  encoding: encoding];
				    encoding: encoding
	} else
# endif
				      length: [data count]];
		@throw [OFUnsupportedProtocolException exceptionWithURL: URL];

	objc_autoreleasePoolPop(pool);

		objc_autoreleasePoolPop(pool);
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}
#endif

- (instancetype)initWithSerialization: (OFXMLElement *)element
{
	@try {
		void *pool = objc_autoreleasePoolPush();

		if (![[element namespace] isEqual: OF_SERIALIZATION_NS])